tAdd improvements to OpenRC initscripts. - tordam - A library for peer discovery inside the Tor network
HTML git clone https://git.parazyd.org/tordam
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 827c61575a30fb5af97f94f6de741d93a13a2f77
DIR parent 77feb15fd76bea2b9b1f1814e85b5279954c992e
HTML Author: parazyd <parazyd@dyne.org>
Date: Mon, 12 Mar 2018 14:31:21 +0100
Add improvements to OpenRC initscripts.
Diffstat:
M contrib/dam-client.init | 11 ++++++++++-
M contrib/dam-dir.init | 11 ++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
---
DIR diff --git a/contrib/dam-client.init b/contrib/dam-client.init
t@@ -12,7 +12,16 @@ depend() {
}
start() {
+ ebegin "Starting $description"
+ _h="$(getent passwd $damuid | cut -d: -f6)"
start-stop-daemon --start --background -u $damuid -g $damgid \
--make-pidfile --pidfile $pidfile \
- --startas /bin/sh -- -c "exec $command >> $damlog 2>&1"
+ --startas /bin/sh -- -c "export HOME=$_h && exec $command >> $damlog 2>&1"
+}
+
+stop() {
+ ebegin "Stopping $description"
+ _chld="$(pgrep -P $(cat $pidfile) | tr '\n' ' ')"
+ kill $_chld || true
+ start-stop-daemon --stop --pidfile $pidfile
}
DIR diff --git a/contrib/dam-dir.init b/contrib/dam-dir.init
t@@ -13,7 +13,16 @@ depend() {
}
start() {
+ ebegin "Starting $description"
+ _h="$(getent passwd $damuid | cut -d: -f6)"
start-stop-daemon --start --background -u $damuid -g $damgid \
--make-pidfile --pidfile $pidfile \
- --startas /bin/sh -- -c "exec $command >> $damlog 2>&1"
+ --startas /bin/sh -- -c "export HOME=$_h && exec $command >> $damlog 2>&1"
+}
+
+stop() {
+ ebegin "Stopping $description"
+ _chld="$(pgrep -P $(cat $pidfile) | tr '\n' ' ')"
+ kill $_chld || true
+ start-stop-daemon --stop --pidfile $pidfile
}