Add runit config files

Closes #657

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-29 13:41:55 +02:00
parent 7df18577e7
commit 9d15e442af
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
9 changed files with 53 additions and 0 deletions

17
support/runit/README.md Normal file
View file

@ -0,0 +1,17 @@
## runit config files
These are the config files to run _Mobilizon_ under `runit` supervisor.
The `user` directory contains the configs for running it completely under a
user, with full supervisory control. It requires the system to start
`runsvdir` in user mode so the dæmon can be handled as the user as
- `sv start ~/sv/mobilizon`
- `sv stop ~/sv/mobilizon`
This method is good when you are not root, or it's not simple to switch.
The `system_wide` directory contains the config to administer by root user,
if you can access root easily.

View file

@ -0,0 +1,5 @@
#!/bin/sh
cd /opt/mobilizon
exec 2>&1
exec chpst -u mobilizon /opt/mobilizon/bin/mobilizon stop

View file

@ -0,0 +1,3 @@
#!/bin/sh
mkdir -p $HOME/log
exec chpst -u mobilizon svlogd -tt $HOME/log/

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /opt/mobilizon
exec 2>&1
exec chpst -u mobilizon /opt/mobilizon/bin/mobilizon start

View file

@ -0,0 +1,3 @@
#!/bin/sh
mkdir -p /var/log/mobilizon/
exec chpst -u mobilizon svlogd -tt /var/log/mobilizon/

View file

@ -0,0 +1,9 @@
#!/bin/sh
export USER="mobilizon"
export HOME="/home/$USER"
groups="$(id -Gn "$USER" | tr ' ' ':')"
svdir="$HOME/service"
exec chpst -u "$USER:$groups" runsvdir "$svdir"

View file

@ -0,0 +1,5 @@
#!/bin/sh
cd /opt/mobilizon
exec 2>&1
exec /opt/mobilizon/bin/mobilizon stop

View file

@ -0,0 +1,3 @@
#!/bin/sh
mkdir -p $HOME/log
exec svlogd -tt $HOME/log/

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /opt/mobilizon
exec 2>&1
exec /opt/mobilizon/bin/mobilizon start