aboutsummaryrefslogtreecommitdiffstats
path: root/main/tinc/tincd.initd
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2014-06-07 10:21:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-06-09 08:52:43 +0000
commit14b0a8983c5199a8359ab6a1af9e79817c13a6a3 (patch)
tree3b7ca41c69d6f70a13801e97929189cf1c09dd2d /main/tinc/tincd.initd
parent2d31fc1c4b1645956c5995c41298c7332ee36807 (diff)
downloadaports-14b0a8983c5199a8359ab6a1af9e79817c13a6a3.tar.bz2
aports-14b0a8983c5199a8359ab6a1af9e79817c13a6a3.tar.xz
main/tinc: fixed init scripts
This patch fixes an init script bug which caused 'restart' to fail & which sometimes could only be cleared by a reboot (--localstatedir was set as /usr/var so the pid was never found). I changed 'stop' to use the start-stop-daemon as in tinc 1.1pre10 there is no longer an option to --kill. Message for an already stopped daemon corrected. For the same reason I also changed 'reload' to use kill -1 $pid.
Diffstat (limited to 'main/tinc/tincd.initd')
-rw-r--r--main/tinc/tincd.initd7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/tinc/tincd.initd b/main/tinc/tincd.initd
index 6ed1bef957..c302f4fe0c 100644
--- a/main/tinc/tincd.initd
+++ b/main/tinc/tincd.initd
@@ -4,6 +4,7 @@
# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd,v 1.5 2008/04/01 14:08:45 dragonheart Exp $
extra_started_commands="reload"
+daemon=/usr/sbin/tincd
depend() {
use logger dns
@@ -29,7 +30,7 @@ start() {
eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
else
ebegin "Starting tinc network $TINCNET"
- /usr/sbin/tincd --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
+ $daemon --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
eend $?
fi
done
@@ -43,7 +44,7 @@ stop() {
if [ -f /var/run/tinc."$TINCNET".pid ]
then
ebegin "Stopping tinc network $TINCNET"
- /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid
+ start-stop-daemon --stop --quiet --pidfile=/var/run/tinc.$TINCNET.pid --exec ${daemon}
eend $?
fi
done
@@ -57,7 +58,7 @@ reload() {
if [ -f /var/run/tinc."$TINCNET".pid ]
then
ebegin "Reloading tinc network $TINCNET"
- /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid
+ kill -1 $(awk '{ print $1 }' /var/run/tinc."$TINCNET".pid)
eend $?
fi
done