commit:     573964683c6f490e3a1ff040ec21c9d3b8d8b154
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  8 07:08:17 2025 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Mon Sep  8 07:10:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57396468

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 <AT> gentoo.org>

 net-p2p/syncthing/files/syncthing.confd-r1 | 28 ++++++++++++++++++++++++++++
 net-p2p/syncthing/files/syncthing.initd-r3 | 28 ++++++++++++++++++++++++++++
 net-p2p/syncthing/syncthing-2.0.6.ebuild   |  4 ++--
 3 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/net-p2p/syncthing/files/syncthing.confd-r1 
b/net-p2p/syncthing/files/syncthing.confd-r1
new file mode 100644
index 000000000000..364042628686
--- /dev/null
+++ b/net-p2p/syncthing/files/syncthing.confd-r1
@@ -0,0 +1,28 @@
+# /etc/conf.d/syncthing: config file for /etc/init.d/syncthing
+
+# umask used to create files
+# The default allows group access
+#umask=007
+
+# Nice level of syncthing
+#SSD_NICELEVEL=0
+
+# I/O nice level of syncthing
+#SSD_IONICELEVEL=0
+
+# User and group as which to run
+#SYNCTHING_USER=syncthing
+#SYNCTHING_GROUP=syncthing
+
+# Configuration directory
+#SYNCTHING_HOMEDIR="/var/lib/syncthing/.config/syncthing"
+
+# Log file location
+#SYNCTHING_LOGFILE="/var/log/syncthing/syncthing.log"
+
+# Where the syncthing GUI should listen. Can be a http(s) URI or a Unix domain 
socket
+#SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8384";
+#SYNCTHING_GUI_ADDRESS="unix:/run/syncthing.sock"
+
+# Extra options for syncthing
+#SYNCTHING_OPTS=""

diff --git a/net-p2p/syncthing/files/syncthing.initd-r3 
b/net-p2p/syncthing/files/syncthing.initd-r3
new file mode 100644
index 000000000000..a21fba268b3c
--- /dev/null
+++ b/net-p2p/syncthing/files/syncthing.initd-r3
@@ -0,0 +1,28 @@
+#!/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}
+}

diff --git a/net-p2p/syncthing/syncthing-2.0.6.ebuild 
b/net-p2p/syncthing/syncthing-2.0.6.ebuild
index b05a787ba2f6..d5d454aee45a 100644
--- a/net-p2p/syncthing/syncthing-2.0.6.ebuild
+++ b/net-p2p/syncthing/syncthing-2.0.6.ebuild
@@ -87,8 +87,8 @@ src_install() {
 
        systemd_dounit etc/linux-systemd/system/${PN}@.service
        systemd_douserunit etc/linux-systemd/user/${PN}.service
-       newconfd "${FILESDIR}"/${PN}.confd ${PN}
-       newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN}
+       newconfd "${FILESDIR}"/${PN}.confd-r1 ${PN}
+       newinitd "${FILESDIR}"/${PN}.initd-r3 ${PN}
        exeinto /etc/user/init.d
        newexe "${FILESDIR}"/syncthing.initd-user syncthing
 

Reply via email to