1 |
commit: a121cdb69c3887a83315cb88dbb285712176a779 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 27 14:11:01 2022 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 27 14:15:28 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a121cdb6 |
7 |
|
8 |
net-p2p/syncthing: make syncthing OpenRC service ready for multiple instances |
9 |
|
10 |
Thanks-to: Till Schäfer <till2.schaefer <AT> uni-dortmund.de> |
11 |
Closes: https://bugs.gentoo.org/831735 |
12 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
13 |
|
14 |
net-p2p/syncthing/files/syncthing.confd | 4 +++ |
15 |
net-p2p/syncthing/files/syncthing.initd-r2 | 33 ++++++++++++++++++++++ |
16 |
...ng-1.18.6.ebuild => syncthing-1.18.6-r1.ebuild} | 2 +- |
17 |
3 files changed, 38 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/net-p2p/syncthing/files/syncthing.confd b/net-p2p/syncthing/files/syncthing.confd |
20 |
index 33773dc7fdf9..eb70f1adef95 100644 |
21 |
--- a/net-p2p/syncthing/files/syncthing.confd |
22 |
+++ b/net-p2p/syncthing/files/syncthing.confd |
23 |
@@ -20,5 +20,9 @@ |
24 |
# Nice level of syncthing |
25 |
#SYNCTHING_NICE="0" |
26 |
|
27 |
+# Where the syncthing GUI should listen. Can be a http(s) URI or a Unix domain socket |
28 |
+#SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8384" |
29 |
+#SYNCTHING_GUI_ADDRESS="unix:/run/syncthing.sock" |
30 |
+ |
31 |
# Extra options for syncthing |
32 |
#SYNCTHING_OPTS="" |
33 |
|
34 |
diff --git a/net-p2p/syncthing/files/syncthing.initd-r2 b/net-p2p/syncthing/files/syncthing.initd-r2 |
35 |
new file mode 100644 |
36 |
index 000000000000..d8e46180df12 |
37 |
--- /dev/null |
38 |
+++ b/net-p2p/syncthing/files/syncthing.initd-r2 |
39 |
@@ -0,0 +1,33 @@ |
40 |
+#!/sbin/openrc-run |
41 |
+# Copyright 1999-2022 Gentoo Authors |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+ |
44 |
+SYNCTHING_USER=${SYNCTHING_USER:-syncthing} |
45 |
+SYNCTHING_GROUP=${SYNCTHING_GROUP:-syncthing} |
46 |
+SYNCTHING_HOMEDIR=${SYNCTHING_HOMEDIR:-/var/lib/syncthing/.config/syncthing} |
47 |
+SYNCTHING_LOGFILE=${SYNCTHING_LOGFILE:-/var/log/syncthing/syncthing.log} |
48 |
+SYNCTHING_UMASK=${SYNCTHING_UMASK:-007} |
49 |
+SYNCTHING_IONICE=${SYNCTHING_IONICE:-0} |
50 |
+SYNCTHING_NICE=${SYNCTHING_NICE:-0} |
51 |
+SYNCTHING_GUI_ADDRESS=${SYNCTHING_GUI_ADDRESS:-http://127.0.0.1:8384} |
52 |
+ |
53 |
+description="Syncthing is an open, trustworthy and decentralized cloud storage system" |
54 |
+command="/usr/bin/syncthing" |
55 |
+command_args="-no-browser -home=${SYNCTHING_HOMEDIR} -gui-address=${SYNCTHING_GUI_ADDRESS} ${SYNCTHING_OPTS}" |
56 |
+pidfile="/run/${RC_SVCNAME}.pid" |
57 |
+command_background="yes" |
58 |
+command_user="${SYNCTHING_USER}:${SYNCTHING_GROUP}" |
59 |
+umask="${SYNCTHING_UMASK}" |
60 |
+start_stop_daemon_args="--ionice ${SYNCTHING_IONICE} \ |
61 |
+ --nicelevel ${SYNCTHING_NICE}" |
62 |
+output_log="\"${SYNCTHING_LOGFILE}\"" |
63 |
+error_log="\"${SYNCTHING_LOGFILE}\"" |
64 |
+ |
65 |
+depend() { |
66 |
+ need localmount net |
67 |
+} |
68 |
+ |
69 |
+start_pre() { |
70 |
+ checkpath -q -d -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_HOMEDIR} |
71 |
+ checkpath -q -f -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_LOGFILE} |
72 |
+} |
73 |
|
74 |
diff --git a/net-p2p/syncthing/syncthing-1.18.6.ebuild b/net-p2p/syncthing/syncthing-1.18.6-r1.ebuild |
75 |
similarity index 99% |
76 |
rename from net-p2p/syncthing/syncthing-1.18.6.ebuild |
77 |
rename to net-p2p/syncthing/syncthing-1.18.6-r1.ebuild |
78 |
index e7512849c254..dfa6d9a4188d 100644 |
79 |
--- a/net-p2p/syncthing/syncthing-1.18.6.ebuild |
80 |
+++ b/net-p2p/syncthing/syncthing-1.18.6-r1.ebuild |
81 |
@@ -855,7 +855,7 @@ src_install() { |
82 |
systemd_dounit etc/linux-systemd/system/${PN}{@,-resume}.service |
83 |
systemd_douserunit etc/linux-systemd/user/${PN}.service |
84 |
newconfd "${FILESDIR}"/${PN}.confd ${PN} |
85 |
- newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN} |
86 |
+ newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN} |
87 |
|
88 |
keepdir /var/log/${PN} |
89 |
insinto /etc/logrotate.d |