Stopping resolvconf doesn't disable updates because Upstart doesn't run the pre-stop script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
resolvconf (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
upstart (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
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/
+++ /etc/init/
@@ -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
Related branches
Changed in resolvconf (Ubuntu): | |
status: | Triaged → Fix Committed |
I wrote:
> The following change seems to fix this.
But don't make that change, because then updates are not enabled after reboot!
(rebooted)
# ls -l /run/resolvconf
total 4
drwxr-xr-x 2 root root 60 2012-02-16 17:12 interface/
-rw-r--r-- 1 root root 0 2012-02-16 17:12 postponed-update
-rw-r--r-- 1 root root 151 2012-02-16 17:12 resolv.conf
Combined with the curious fact that, after boot, the status of resolvconf is "stop/waiting" and not "running" (as I earlier mentioned here: https:/ /bugs.launchpad .net/ubuntu/ +source/ resolvconf/ +bug/929552/ comments/ 16), it looks to me as if resolvconf is both started and stopped on boot, except that pre-stop scripts are not run. Or something. I don't understand Upstart.