From a0bb9d443fb7e8cbc07c904b4d50a1e12a664f7c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 23 Jun 2014 09:46:54 -0400 Subject: [PATCH] Import Debian changes 1.0.24-2~bpo70+1 tinc (1.0.24-2~bpo70+1) wheezy-backports; urgency=medium * Backport to wheezy-backports. * Add myself to Uploaders. tinc (1.0.24-2) unstable; urgency=medium * Improve the init script: stopping tinc now waits for the process to terminate. If that doesn't happen in 5 seconds, it will send the TERM signal again (which helps if tinc is waiting for a script to finish executing). It now also detects whether the process mentioned in the PID file is actually running, and if not it will exit early and without warnings. Closes: #748107 --- debian/changelog | 18 ++++++++++++++++++ debian/control | 1 + debian/tinc.init | 41 +++++++++++++++++++++++++++++------------ 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index e45ef7e..9ebdf1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +tinc (1.0.24-2~bpo70+1) wheezy-backports; urgency=medium + + * Backport to wheezy-backports. + * Add myself to Uploaders. + + -- Micah Anderson Mon, 23 Jun 2014 09:46:54 -0400 + +tinc (1.0.24-2) unstable; urgency=medium + + * Improve the init script: stopping tinc now waits for the process to + terminate. If that doesn't happen in 5 seconds, it will send the TERM + signal again (which helps if tinc is waiting for a script to finish + executing). It now also detects whether the process mentioned in the PID + file is actually running, and if not it will exit early and without + warnings. Closes: #748107 + + -- Guus Sliepen Wed, 14 May 2014 21:44:16 +0200 + tinc (1.0.24-1) unstable; urgency=medium [ Guus Sliepen ] diff --git a/debian/control b/debian/control index feaa1c4..8daa21d 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,7 @@ Maintainer: Guus Sliepen Standards-Version: 3.9.5 Build-Depends: libssl-dev, debhelper (>= 9), gettext, texinfo, zlib1g-dev, liblzo2-dev, libvdeplug-dev Homepage: http://www.tinc-vpn.org/ +Uploaders: Micah Anderson Package: tinc Architecture: any diff --git a/debian/tinc.init b/debian/tinc.init index c44af7e..813a59c 100644 --- a/debian/tinc.init +++ b/debian/tinc.init @@ -73,28 +73,45 @@ test -n "$LIMITS" && setlimits $LIMITS start() { $DAEMON $EXTRA -n "$@" } + stop() { - $DAEMON -n $1 -k + [ -f /var/run/tinc.$1.pid ] || return + read pid rest /dev/null || return + + $DAEMON -n $1 -k || return + + i=0; + sleep 0.5 + + # Wait for the pidfile to disappear + while [ -f /var/run/tinc.$1.pid ]; do + # And check that there is an actual process running + kill -0 "$pid" 2>/dev/null || return + + if [ $i = '10' ] ; then + # It's still alive, kill it again and give up + $DAEMON -n $1 -k && sleep 0.5 + break + else + echo -n "." + i=$(($i+1)) + fi + + sleep 0.5 + done } + reload() { $DAEMON -n $1 -kHUP } + alarm() { $DAEMON -n $1 -kALRM } + restart() { stop "$@" - sleep 0.5 - i=0; - while [ -f /var/run/tinc.$1.pid ] ; do - if [ $i = '10' ] ; then - break - else - echo -n "." - sleep 0.5 - i=$(($i+1)) - fi - done start "$@" }