Add runit config files
Closes #657 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
7df18577e7
commit
9d15e442af
17
support/runit/README.md
Normal file
17
support/runit/README.md
Normal 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.
|
5
support/runit/system_wide/sv/mobilizon/finish
Executable file
5
support/runit/system_wide/sv/mobilizon/finish
Executable file
@ -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
Executable file
3
support/runit/system_wide/sv/mobilizon/log/run
Executable file
@ -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
Executable file
4
support/runit/system_wide/sv/mobilizon/run
Executable file
@ -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
Executable file
3
support/runit/user/root_sv/mobilizon/log/run
Executable file
@ -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
Executable file
9
support/runit/user/root_sv/mobilizon/run
Executable 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"
|
5
support/runit/user/user_sv/mobilizon/finish
Executable file
5
support/runit/user/user_sv/mobilizon/finish
Executable file
@ -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
Executable file
3
support/runit/user/user_sv/mobilizon/log/run
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
mkdir -p $HOME/log
|
||||||
|
exec svlogd -tt $HOME/log/
|
4
support/runit/user/user_sv/mobilizon/run
Executable file
4
support/runit/user/user_sv/mobilizon/run
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd /opt/mobilizon
|
||||||
|
exec 2>&1
|
||||||
|
exec /opt/mobilizon/bin/mobilizon start
|
Loading…
Reference in New Issue
Block a user