[Bug 933566] Re: Stopping resolvconf doesn't disable updates because Upstart doesn't run the pre-stop script

Thomas Hood 933566 at bugs.launchpad.net
Wed Feb 22 15:03:29 UTC 2012


I wrote above in #7:
> If we can't get Upstart fixed in an acceptable time frame then
> I'd propose a different workaround. Create a resolvconf-stop
> Upstart job that *starts* on runlevel [06] and that disables
> updates in its pre-start.

I have been re-reading the Upstart documentation and although the other
solution (of continuing to treat resolvconf itself as an Upstart service
job but changing the exit codes of "/sbin/resolvconf --enable-updates")
has been adopted and works, I am now in a position to re-describe my
alternative, quoted above, using Upstart terminology.  The alternative
is, namely, to replace the service job with a "resolvconf-initialize"
task job and a "resolvconf-finalize" task job. The alternative is closer
to how things work in Debian where resolvconf has scripts that run only
in runlevels S and 06, and has the advantage that Upstart doesn't have
to track resolvconf's enabledness (= presence of flag file
/run/resolvconf/enable-updates) with its own concept of startedness ---
with the risk of being wrong.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to resolvconf in Ubuntu.
https://bugs.launchpad.net/bugs/933566

Title:
  Stopping resolvconf doesn't disable updates because Upstart doesn't
  run the pre-stop script

Status in “resolvconf” package in Ubuntu:
  Fix Released
Status in “upstart” package in Ubuntu:
  Confirmed

Bug description:
  Stopping the resolvconf job should disable updates by means of
  deleting the enable-updates flag file, but this does not happen.

  # ls -l /run/resolvconf
  total 4
  -rw-r--r-- 1 root root   0 2012-02-16 17:02 enable-updates
  drwxr-xr-x 2 root root  60 2012-02-16 17:02 interface
  -rw-r--r-- 1 root root 177 2012-02-16 17:02 resolv.conf
  # stop resolvconf
  stop: Unknown instance: 
  # ls -l /run/resolvconf
  total 4
  -rw-r--r-- 1 root root   0 2012-02-16 17:02 enable-updates
  drwxr-xr-x 2 root root  60 2012-02-16 17:02 interface
  -rw-r--r-- 1 root root 177 2012-02-16 17:02 resolv.conf
  # start resolvconf 
  resolvconf start/running
  # stop resolvconf
  resolvconf stop/waiting
  # ls -l /run/resolvconf
  total 4
  -rw-r--r-- 1 root root   0 2012-02-16 17:06 enable-updates
  drwxr-xr-x 2 root root  60 2012-02-16 17:02 interface
  -rw-r--r-- 1 root root 177 2012-02-16 17:02 resolv.conf

  
  The following change seems to fix this.

  
  --- /etc/init/resolvconf.conf_ORIG	2012-02-16 17:09:22.313489458 +0100
  +++ /etc/init/resolvconf.conf	2012-02-16 17:08:31.398957282 +0100
  @@ -14,6 +14,6 @@
   	resolvconf --enable-updates
   end script
   
  -pre-stop script
  +post-stop script
   	resolvconf --disable-updates
   end script

  
  # stop resolvconf
  resolvconf stop/waiting
  # ls -l /run/resolvconf
  total 4
  drwxr-xr-x 2 root root  60 2012-02-16 17:02 interface
  -rw-r--r-- 1 root root 177 2012-02-16 17:02 resolv.conf

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/933566/+subscriptions




More information about the foundations-bugs mailing list