Resolvconf error condition on enable/disable update should reflect success of just that

Bug #936835 reported by Thomas Hood
0
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
In Progress
Undecided
Unassigned

Bug Description

For background see #933566.

When Upstart attempts to start a job and the pre-start script returns an error, Upstart will consider the job not to have been started.

Because resolvconf is treated as an Upstart job, resolvconf updates being enabled/disable should correspond to resolvconf Upstart job being "started"/"stopped".

So the resolvconf job pre-start script should return an error when and only when updates could not be enabled.

Making this so requires that resolvconf (1.63ubuntu7) be patched as follows.

$ diff -u resolvconf_ORIG resolvconf
--- resolvconf_ORIG 2012-02-19 16:49:46.725254960 +0100
+++ resolvconf 2012-02-19 16:51:39.277257572 +0100
@@ -113,9 +113,9 @@
  fi
  ;;
   --enable-updates)
- : >| "$ENABLE_UPDATES_FLAGFILE"
+ : >| "$ENABLE_UPDATES_FLAGFILE" || exit 1
  if [ -e "$POSTPONED_UPDATE_FLAGFILE" ] ; then
- update_and_exit -u
+ (update_and_exit -u) || :
  fi
  exit 0
  ;;

Revision history for this message
Thomas Hood (jdthood) wrote :

Note the parentheses around "update_and_exit -u". They are needed because the update_and_exit function execs run-parts. With the parentheses the "|| :" won't have any effect.

Revision history for this message
Thomas Hood (jdthood) wrote :

s/With the parentheses/Without the parentheses/

Thomas Hood (jdthood)
Changed in resolvconf (Ubuntu):
status: New → In Progress
Revision history for this message
Thomas Hood (jdthood) wrote :

Steve: I don't see the similarity between this report (about /sbin/resolvconf exit status) and #933723 (about bind9 calling resolvconf when it shouldn't). Can you explain a bit?

In any case, I see you have committed the fix[0], so perhaps it's academic.

[0]http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/resolvconf/precise/revision/51

Revision history for this message
Steve Langasek (vorlon) wrote :

> Steve: I don't see the similarity between this report (about
> /sbin/resolvconf exit status) and #933723 (about bind9 calling
> resolvconf when it shouldn't). Can you explain a bit?

Sorry, I meant to mark this as a duplicate of bug #927803. Fixed, though that means I also referenced the wrong bug in the changelog of the upload; ohwell.

> In any case, I see you have committed the fix[0], so perhaps it's
> academic.

Yeah, pretty much.

Revision history for this message
Thomas Hood (jdthood) wrote :

I have installed 1.63ubuntu8 and everything seems to work perfectly now on my Oneiric-with-some-Precise-bits laptop.

$ dpkg -l resolvconf postfix upstart
[...]
ii postfix 2.8.7-1ubuntu2 High-performance mail transport agent
ii resolvconf 1.63ubuntu8 name server information handler
ii upstart 1.4-0ubuntu8 event-based init daemon
$ status resolvconf
resolvconf start/running
# ls -l /var/log/upstart/resolvconf.log
-rw-r----- 1 root root 0 2012-02-19 10:55 /var/log/upstart/resolvconf.log

Thanks!
--
Thomas

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.