From 14b0a8983c5199a8359ab6a1af9e79817c13a6a3 Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Sat, 7 Jun 2014 10:21:07 +0000 Subject: 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. --- main/tinc/tincd.initd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'main/tinc/tincd.initd') 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 -- cgit v1.2.3