Files
gentoo/net-p2p/syncthing/files/syncthing.initd-r3
Marc Schiffbauer 573964683c net-p2p/syncthing: improve initd/confd for 2.0.6
Thanks to fkobi for requesting this change, see
https://github.com/gentoo/gentoo/pull/43667#issuecomment-3263652528

Signed-off-by: Marc Schiffbauer <mschiff@gentoo.org>
2025-09-08 09:10:22 +02:00

29 lines
1.0 KiB
Plaintext

#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
SYNCTHING_USER=${SYNCTHING_USER:-syncthing}
SYNCTHING_GROUP=${SYNCTHING_GROUP:-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="Syncthing is an open, trustworthy and decentralized cloud storage system"
command="/usr/bin/syncthing"
command_args="-no-browser -home=${SYNCTHING_HOMEDIR} -gui-address=${SYNCTHING_GUI_ADDRESS} ${SYNCTHING_OPTS}"
pidfile="/run/${RC_SVCNAME}.pid"
command_background="yes"
command_user="${SYNCTHING_USER}:${SYNCTHING_GROUP}"
output_log="\"${SYNCTHING_LOGFILE}\""
error_log="\"${SYNCTHING_LOGFILE}\""
depend() {
need localmount
after net
}
start_pre() {
checkpath -q -d -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_HOMEDIR}
checkpath -q -f -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_LOGFILE}
}