Rework OpenRC initscripts so they are symlinkable. - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit b4cc2ac78ab2c2adfb2c9f5d484a85d6a62b24b4
(DIR) parent 6fcf2a6aff1c5c4cdf4ce029209b7bf624fbcd72
(HTM) Author: parazyd <parazyd@dyne.org>
Date: Sun, 14 Jul 2019 14:56:04 +0200
Rework OpenRC initscripts so they are symlinkable.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
M rc.d/Gentoo.conf.d | 3 +--
M rc.d/Gentoo.init.d | 20 ++++++--------------
2 files changed, 7 insertions(+), 16 deletions(-)
---
(DIR) diff --git a/rc.d/Gentoo.conf.d b/rc.d/Gentoo.conf.d
@@ -1,5 +1,4 @@
#
# Parameters to be passed to geomyidae
#
-GEOMYIDAE_ARGS="-d -u gopherd -g gopherd -b /var/gopher -o 70 -l /var/log/geomyidae.log -h localhost"
-
+GEOMYIDAE_ARGS="-d -u gopherd -g gopherd -b /var/gopher -o 70 -l /var/log/${RC_SVCNAME}.log -h localhost"
(DIR) diff --git a/rc.d/Gentoo.init.d b/rc.d/Gentoo.init.d
@@ -1,17 +1,9 @@
#!/sbin/openrc-run
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-start(){
- ebegin "Starting geomyidae"
- [ -n "$GEOMYIDAE_ARGS" ] && GEOMYIDAE_ARGS="-- $GEOMYIDAE_ARGS"
- start-stop-daemon -Sbm -p /run/geomyidae.pid -x /usr/sbin/geomyidae $GEOMYIDAE_ARGS
- eend $? "Failed to start geomyidae"
-}
-
-stop(){
- ebegin "Stopping geomyidae"
- start-stop-daemon -K -p /var/run/geomyidae.pid
- eend $? "Failed to stop geomyidae"
-}
+name="${RC_SVCNAME}"
+command="/usr/bin/geomyidae"
+pidfile="/run/${RC_SVCNAME}.pid"
+command_args="${GEOMYIDAE_ARGS}"
+command_background="yes"