init script fails to start unbound with /bin/sh=dash

Bug #281033 reported by Tv
16
Affects Status Importance Assigned to Milestone
unbound (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: unbound

It just said:

Setting up unbound (1.0.0-3) ...
 * Starting recursive DNS server unbound invoke-rc.d: initscript unbound, action "start" failed.
dpkg: error processing unbound (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 unbound
E: Sub-process /usr/bin/dpkg returned an error code (1)

Trying manually:

[100 tv@musti ~]$ sudo sh -x /etc/init.d/unbound start
...
+ printf * Starting recursive DNS server unbound
 * Starting recursive DNS server unbound + /usr/bin/expr 83 - 1
+ /usr/bin/tput hpa 82
                                                                                  + printf
 + already_running
+ return start-stop-daemon --start --pidfile /var/lib/unbound/unbound.pid --startas /usr/sbin/unbound --test

But it's not running:

[2 tv@musti ~]$ ps uaxw|grep unbound
tv 18362 0.0 0.0 8284 784 pts/0 R+ 17:20 0:00 grep unbound

Editing the init script and removing "return" from already_running made it work:

already_running() {
    start-stop-daemon --start --pidfile $PIDFILE \
        --startas $DAEMON --test >/dev/null 2>&1
}

Posix shell stuff? My /bin/sh is dash

Revision history for this message
Miguel Pérez Colino (migpc) wrote :

Checked, and behaved just like commented.

start-stop-daemon with --test option should return the righrt value:

       -t, --test
              Print actions that would be taken and set appropriate return
              value, but take no action.

I'd accept the suggested modification as a patch.

Revision history for this message
Ondřej Surý (ondrej) wrote :

This is already fixed in jaunty (merged from debian).

Revision history for this message
Michael Jeanson (mjeanson) wrote :

Fixed in Jaunty

Changed in unbound:
status: New → Fix Released
Revision history for this message
Gary (garypdx) wrote :

FYI, to fix this problem with intrepid you'll need to manually download and install the .deb from the jaunty dist. It will then uninstall as well.

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.