Package: ddclient
Followup-For: Bug #652298

Hi,

Attached is a patch which fixes this bug.

Best,
Teemu

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: mips

Kernel: Linux 3.3.8
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ddclient depends on:
ii  debconf [debconf-2.0]  1.5.49
ii  initscripts            2.88dsf-41
ii  lsb-base               4.1+Debian8
ii  perl [perl5]           5.14.2-20

Versions of packages ddclient recommends:
ii  libio-socket-ssl-perl  1.76-2

ddclient suggests no packages.

-- debconf information excluded
>From 68b6c85a4ed90104859a9213b6d53bb2a3782cf7 Mon Sep 17 00:00:00 2001
From: Teemu Ikonen <tpiko...@gmail.com>
Date: Thu, 28 Mar 2013 20:58:57 +0100
Subject: [PATCH] Call start-stop-daemon with --exec instead of --name.

ddclient rewrites its process name during operation as a kind of status
update, so running start-stop-daemon with --name matching in the init
script does not work (without patching ddclient to stop messing with its
name). Use --exec with the perl interpreter path instead, which together
with --pidfile gives a good chance that unrelated processes are not killed
by the init script.

Fixes Debian bug #652298.
---
 debian/ddclient.init |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/ddclient.init b/debian/ddclient.init
index 513bfea..12b58a3 100644
--- a/debian/ddclient.init
+++ b/debian/ddclient.init
@@ -16,6 +16,7 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 NAME="ddclient"
 DAEMON=/usr/sbin/$NAME
+PERL=/usr/bin/perl
 DESC="Dynamic DNS service update utility"
 
 # Don't run if not installed
@@ -52,12 +53,12 @@ do_start()
 	#   1 if daemon was already running
 	#   2 if daemon could not be started
 	start-stop-daemon --test --start --quiet \
-		--pidfile $PIDFILE --name $NAME --startas $DAEMON \
+		--pidfile $PIDFILE --exec $PERL --startas $DAEMON \
 		>/dev/null \
 		|| return 1
 
-	start-stop-daemon --start --quiet \
-		--pidfile $PIDFILE --name $NAME --startas $DAEMON \
+	start-stop-daemon --start \
+		--pidfile $PIDFILE --exec $PERL --startas $DAEMON \
 		-- $OPTIONS \
 		|| return 2
 }
@@ -76,8 +77,8 @@ do_stop()
 	#   1 if daemon was already stopped
 	#   2 if daemon could not be stopped
 	#   other if a failure occurred
-	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
-		--pidfile $PIDFILE --name $NAME
+	start-stop-daemon --stop --retry=TERM/30/KILL/5 \
+		--pidfile $PIDFILE --exec $PERL
 	return "$?"
 }
 
-- 
1.7.10.4

Reply via email to