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.
This commit is contained in:
Clayton Craft 2024-07-22 13:42:45 -07:00 committed by omni
parent 7009d5e978
commit 119061da8f
2 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@
# Maintainer: Sertonix <sertonix@posteo.net>
pkgname=syncthing
pkgver=1.27.10
pkgrel=0
pkgrel=1
pkgdesc="Open Source Continuous File Synchronization"
url="https://syncthing.net/"
arch="all"
@ -81,5 +81,5 @@ sha512sums="
38b570f23537f7c0fb8f3a3f1f962c93416d7089639097f4b88565905858c4c801b0879d77b46420a12df266f8821e37bae7a7e75b10a0962455dfce8329b0f8 syncthing-1.27.10.tar.gz
30c96641f073ba732d495e9df4b04a9f00ddb19439b4764c2aef07e4ec4a5f53ec6527210c76dc2d2af8f76a37666e44c57acd444206427a258c1b39b53ee5d0 build-unset-CGO_ENABLED.patch
81bcb6b2e0956624b596201d1de24a3b6fcb10d08761f2c426081350b611295a7f4d47775d175f2ee5dbbb289b98bc022389fc9992f0d31bcdbfde855ceafaf8 only-test-with-race-when-provided.patch
8c95d8794e10c97d6546a48b07af769e9c1b26870fcc53d524868ca6e57e96ad686ebcd988ddb2f355404cced81b9f19eeba99a7c832eb4641ff0066f7916749 syncthing.initd
17da9c6e03efa3b43a4b46bfb85a7a63d393bbe5a8f431e4e6d86a6dcde6dbe0c536d7b29c007a1a5207534519dc87183f6f91e5596ea5e645cd702e4e2478b4 syncthing.initd
"

View File

@ -1,11 +1,10 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
supervisor=supervise-daemon
command=/usr/bin/syncthing
command_args="${SYNCTHING_ARGS:---no-browser}"
command_args="${SYNCTHING_ARGS:---no-browser --no-restart}"
command_user="${SYNCTHING_USER:-syncthing}"
pidfile=/run/${RC_SVCNAME}.pid
command_background=yes
output_logger="logger -t '${RC_SVCNAME}' -p daemon.info"
error_logger="logger -t '${RC_SVCNAME}' -p daemon.error"