gentoo-ebuilds/net-p2p/syncthing/files/syncthing.initd-r5
Filip Kobierski 47bab42079
net-p2p/syncthing: unify openrc services
Notable changes
- use supervisor
- unify with upstream systemd services
  - specifies log formatting
- remove outdated --logflags
- use --log_file instead of _logs

Closes: https://bugs.gentoo.org/966963
Signed-off-by: Filip Kobierski <fkobi@fsfe.org>
Part-of: https://github.com/gentoo/gentoo/pull/45005
Closes: https://github.com/gentoo/gentoo/pull/45005
Signed-off-by: Marc Schiffbauer <mschiff@gentoo.org>
2025-12-14 17:22:51 +01:00

29 lines
919 B
Text

#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
: ${command_user:="syncthing:syncthing"}
SYNCTHING_HOMEDIR=${SYNCTHING_HOMEDIR:-/var/lib/syncthing/.config/syncthing}
SYNCTHING_LOGFILE=${SYNCTHING_LOGFILE:-/var/log/syncthing/syncthing.log}
SYNCTHING_GUI_ADDRESS=${SYNCTHING_GUI_ADDRESS:-http://127.0.0.1:8384}
description="Open Source Continuous File Synchronization"
command="/usr/bin/syncthing"
supervisor=supervise-daemon
command_args="serve --no-browser --no-restart \
--home=${SYNCTHING_HOMEDIR} \
--log-file=\"${SYNCTHING_LOGFILE}\"
--no-log-format-level-string --log-format-level-syslog \
--gui-address=${SYNCTHING_GUI_ADDRESS} \
${SYNCTHING_OPTS}"
depend() {
need localmount
after net
}
start_pre() {
checkpath -q -d -o "${command_user}" "${SYNCTHING_HOMEDIR}"
checkpath -q -f -o "${command_user}" "${SYNCTHING_LOGFILE}"
}