public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-proxy/trojan/files/
@ 2020-09-27 13:47 Yixun Lan
  0 siblings, 0 replies; only message in thread
From: Yixun Lan @ 2020-09-27 13:47 UTC (permalink / raw
  To: gentoo-commits

commit:     af547811efa07620534f0c5b5d1db5fc75ebcf39
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 27 13:43:35 2020 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sun Sep 27 13:47:34 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af547811

net-proxy/trojan: fix permission with log file

Package-Manager: Portage-3.0.0, Repoman-2.3.23
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 net-proxy/trojan/files/trojan.initd | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/net-proxy/trojan/files/trojan.initd b/net-proxy/trojan/files/trojan.initd
index c87f6576d6b..348d307c526 100644
--- a/net-proxy/trojan/files/trojan.initd
+++ b/net-proxy/trojan/files/trojan.initd
@@ -2,6 +2,9 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+TJ_USER=nobody
+TJ_GROUP=nobody
+
 TJ_NAME=${SVCNAME##*.}
 if [ -n "${TJ_NAME}" -a "${SVCNAME}" != "trojan" ]; then
 	TJ_PIDFILE="/run/trojan.${TJ_NAME}.pid"
@@ -19,10 +22,11 @@ depend() {
 
 start() {
 	ebegin "Starting Trojan, Log File: ${TJ_LOG}"
-	start-stop-daemon --start -b \
-		--user nobody --group nobody \
-		-1 "${TJ_LOG}" -2 "${TJ_LOG}" \
-		-m -p "${TJ_PIDFILE}" \
+	checkpath -f -m 0600 -o ${TJ_USER}:${TJ_GROUP} "${TJ_LOG}"
+	start-stop-daemon --start --background \
+		--user ${TJ_USER} --group ${TJ_GROUP} \
+		--stdout "${TJ_LOG}" --stderr "${TJ_LOG}" \
+		--make-pidfile --pidfile "${TJ_PIDFILE}" \
 		--exec /usr/bin/trojan  -- "${TJ_CONFIG}"
 	eend $?
 }
@@ -30,7 +34,7 @@ start() {
 stop() {
 	ebegin "Stopping Trojan"
 	start-stop-daemon --stop \
-		--user nobody --group nobody \
-		-p "${TJ_PIDFILE}"
+		--user ${TJ_USER} --group ${TJ_GROUP} \
+		--pidfile "${TJ_PIDFILE}"
 	eend $?
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-27 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-27 13:47 [gentoo-commits] repo/gentoo:master commit in: net-proxy/trojan/files/ Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox