aboutsummaryrefslogtreecommitdiffstats
path: root/main/tinc/tincd.lo.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.lo.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.lo.initd')
-rw-r--r--main/tinc/tincd.lo.initd9
1 files changed, 5 insertions, 4 deletions
diff --git a/main/tinc/tincd.lo.initd b/main/tinc/tincd.lo.initd
index afa0156812..7ba43fdfa3 100644
--- a/main/tinc/tincd.lo.initd
+++ b/main/tinc/tincd.lo.initd
@@ -4,6 +4,7 @@
# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.lo,v 1.1 2010/07/18 10:04:56 dragonheart Exp $
extra_started_commands="reload"
+daemon=/usr/sbin/tincd
depend()
{
@@ -16,7 +17,7 @@ start()
TINCNET=${RC_SVCNAME#*.}
if [ -f /etc/tinc/"$TINCNET"/tinc.conf ] ; then
ebegin "Starting tinc network $TINCNET"
- /usr/sbin/tincd --debug=1 --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
+ $daemon --debug=1 --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
eend $?
else
eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
@@ -28,10 +29,10 @@ stop()
TINCNET=${RC_SVCNAME#*.}
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 $?
else
- eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
+ eindent "network $TINCNET has already been stopped"
fi
}
@@ -40,7 +41,7 @@ reload()
TINCNET=${RC_SVCNAME#*.}
if [ -f /var/run/tinc."$TINCNET".pid ] ; then
ebegin "Reloading configuration for 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
}