aports/community/syncthing/syncthing.initd
Clayton Craft 119061da8f community/syncthing: use supervise-daemon
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.
2024-08-21 23:27:06 +00:00

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
}