Browse Source

Add runit config files

Closes #657

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
chapril^2
Thomas Citharel 2 weeks ago
parent
commit
9d15e442af
No known key found for this signature in database GPG Key ID: A061B9DDE0CA0773
  1. 17
      support/runit/README.md
  2. 5
      support/runit/system_wide/sv/mobilizon/finish
  3. 3
      support/runit/system_wide/sv/mobilizon/log/run
  4. 4
      support/runit/system_wide/sv/mobilizon/run
  5. 3
      support/runit/user/root_sv/mobilizon/log/run
  6. 9
      support/runit/user/root_sv/mobilizon/run
  7. 5
      support/runit/user/user_sv/mobilizon/finish
  8. 3
      support/runit/user/user_sv/mobilizon/log/run
  9. 4
      support/runit/user/user_sv/mobilizon/run

17
support/runit/README.md

@ -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.

5
support/runit/system_wide/sv/mobilizon/finish

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

3
support/runit/system_wide/sv/mobilizon/log/run

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

4
support/runit/system_wide/sv/mobilizon/run

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

3
support/runit/user/root_sv/mobilizon/log/run

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

9
support/runit/user/root_sv/mobilizon/run

@ -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"

5
support/runit/user/user_sv/mobilizon/finish

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

3
support/runit/user/user_sv/mobilizon/log/run

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

4
support/runit/user/user_sv/mobilizon/run

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