mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
OpenRC's supervisor can handle services that run in the foreground and don't daemonize/background themselves. --no-restart is used so that openrc's respawn_delay, etc are used. This also works around an issue I experienced where rc-service would hang indefinitely when trying to use `rc-service syncthing start` in automation. The issue doesn't happen with supervise-daemon.
15 lines
374 B
Bash
15 lines
374 B
Bash
#!/sbin/openrc-run
|
|
|
|
name=$RC_SVCNAME
|
|
supervisor=supervise-daemon
|
|
command=/usr/bin/syncthing
|
|
command_args="${SYNCTHING_ARGS:---no-browser --no-restart}"
|
|
command_user="${SYNCTHING_USER:-syncthing}"
|
|
output_logger="logger -t '${RC_SVCNAME}' -p daemon.info"
|
|
error_logger="logger -t '${RC_SVCNAME}' -p daemon.error"
|
|
|
|
depend() {
|
|
use logger dns net
|
|
after firewall
|
|
}
|