ddclient init script fails to stop process

Bug #980409 reported by Jon Oler
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
ddclient (Debian)
Fix Released
Unknown
ddclient (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I'm running ddclient 3.8.0-11.4ubuntu1 on ubuntu 12.04. The init script fails to stop the ddclient process (/etc/init.d/ddclient stop) with no errors reported. Starting ddclient when a ddclient process is already running (started from init script) also fails. The problem appears to be that the init script uses '--name ddclient' with start-stop-daemon. However, the process name lookup is failing because ddclient is changing the process name to. for example, 'ddclient - sleeping for 70 seconds'. In other words. the process name is not 'ddclient', but 'ddclient' with some status info tacked on to the end. Since start-stop-daemon is searching for processes named 'ddclient', the lookup never succeeds, so no processes are ever stopped. The start action also always starts a new ddclient process because it never thinks a ddclient process is running. I've fixed this problem locally by removing the 3 instances of the string '--name $NAME' in /etc/init.d/ddclient. I've tested it out, and it does appear to resolve my issue. I'd like to see this change (or a better one) make it to the ubuntu packaging.

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ddclient (Ubuntu):
status: New → Confirmed
Changed in ddclient (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
Changed in ddclient (Debian):
status: Unknown → New
Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Confirming. Removing "--name" as process matching criterium for start-stop-daemon in init-script resolves the issue. The PID file should be sufficient.

Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :

Confirmed the work-around. Here's the changes as a diff:

$ apt-diff ddclient
--- /tmp/apt-diff_1001/extracted/ddclient/etc/init.d/ddclient 2012-08-09 17:33:15.000000000 -0700
+++ /etc/init.d/ddclient 2012-11-24 08:48:39.000000000 -0800
@@ -52,12 +52,12 @@
  # 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 --startas $DAEMON \
   >/dev/null \
   || return 1

  start-stop-daemon --start --quiet \
- --pidfile $PIDFILE --name $NAME --startas $DAEMON \
+ --pidfile $PIDFILE --startas $DAEMON \
   -- $OPTIONS \
   || return 2
 }
@@ -77,7 +77,7 @@
  # 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
+ --pidfile $PIDFILE
  return "$?"
 }

--------------------------------
Found 1 differences between filesystem state and package state
Skipped 1 unverifiable directories
Finished in 0.674012 seconds

Revision history for this message
Tristan Schmelcher (tschmelcher) wrote :

Attaching the diff as a file marked as a patch in the hope that it draws some attention.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to /etc/init.d/ddclient that fixes the bug" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in ddclient (Debian):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ddclient - 3.8.1-1ubuntu2

---------------
ddclient (3.8.1-1ubuntu2) saucy; urgency=low

  * debian/ddclient.NetworkManager
    - Use NetworkManager dispatcher to stop/start ddclient, fixes DNS lookup
      errors that caused checkins to fail (LP: #998700)
  * debian/ddclient.init
    - lintian reports missing runlevels for stop, adjusted to 0 1 6
  [ Tristan Schmelcher ]
  * debian/ddclient.init
    - ddclient init script fails to stop process (LP: #980409)
 -- Ken VanDine <email address hidden> Mon, 29 Jul 2013 09:41:53 -0400

Changed in ddclient (Ubuntu):
status: Triaged → Fix Released
Changed in ddclient (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Rarylson Freitas (rarylson) wrote :

Hi.

Although this thread shows the bug was fixed in the package ddclient@3.8.1-1ubuntu2, the last version in Ubuntu 12.04 LTS actualy is the 3.8.0-11.4ubuntu1. It is, the patch was not applyed to all supported Ubuntu versions.

I tested this and a similar patch as posted in the follow link, and all of them worked in Ubuntu 12.04: https://bugs.launchpad.net/ubuntu/+source/ddclient/+bug/1241612

Can this bugfix be backported to the Ubuntu 12.04 version (3.8.0-11)?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.