Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Bug #38009 reported by Elias Oltmanns
6
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
Fix Released
Medium
MOTU Reviewers Team

Bug Description

The postinst script does the right thing (namely, pointing
/etc/resolvconf/run at /var/run/resolvconf) as long as
/etc/resolvconf/run does not seem to be in a usable state.
Unfortunately, it doesn't handle the case properly if the link points
at /dev/shm/resolvconf because this is a working setup in a system
running breezy. After an update to dapper, however, the init script
for resolvconf will fail as /dev/shm is not available at that stage
during boot up.

Changed in resolvconf:
assignee: nobody → zakame
Revision history for this message
Elias Oltmanns (oltmanns) wrote : Re: [Bug 38009] Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Here is the proposed patch to the postinst script.

Revision history for this message
Elias Oltmanns (oltmanns) wrote : Re: [Bug 38009] Re: [Bug 38009] Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Sorry, trying again. For some reason Melone ate my plain/x-patch
attachment.

Revision history for this message
Elias Oltmanns (oltmanns) wrote : Re: [Bug 38009] Re: [Bug 38009] Re: [Bug 38009] Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Well, application/octet-stream doesn't work either. Here's another go!

--- resolvconf.postinst.orig 2006-04-04 12:04:55.000000000 +0200
+++ resolvconf.postinst 2006-04-04 12:33:20.000000000 +0200
@@ -69,6 +69,9 @@
   if [ -z "$RUN_CANONICALPATH" ] ; then
    report_err "Deleting /etc/resolvconf/run symlink whose canonical path could not be determined"
    rm -f /etc/resolvconf/run
+ elif [ "${RUN_CANONICALPATH}" != "${RUN_CANONICALPATH#/dev/shm}" ] ; then
+ report_err "Deleting /etc/resolvconf/run symlink to /dev/shm (inaccessible during bootup)"
+ rm -f /etc/resolvconf/run
   fi
  fi
  # Delete it if it isn't a directory or a link to one

Revision history for this message
Zak B. Elep (zakame) wrote :

Hi! Thanks for the bug.

However, this is already reported as Bug #33362 which is already fixed. Can you please verify this with the latest Dapper, to make sure?

Thanks,

Changed in resolvconf:
status: Unconfirmed → Needs Info
Revision history for this message
Thomas Templin (coastgnu) wrote :

I did a purge and reinstall of resolvconf and the misbehaviour was still there.

What was missing is a link:

ln -s /var/run/resolvconf/resolv.conf resolv.conf

And resolv.conf is working as I will expect it
:-)

Revision history for this message
Zak B. Elep (zakame) wrote :

Indeed.

resolvconf's debian/init needs to rebuild /var/run/resolvconf... nasty...

Revision history for this message
Sebastian Kapfer (caci) wrote :

The symlink should be /etc/resolv.conf -> /etc/resolvconf/run/resolv.conf (and the /etc/resolvconf/run pointing to /var/run/resolvconf). Of course coastgnu's link has the same effect, just pointing out how it's supposed to work.

Revision history for this message
Sebastian Kapfer (caci) wrote :

And just to state it again here: /etc/init.d/resolvconf already _does_ create the run directory if it is missing.

Revision history for this message
Elias Oltmanns (oltmanns) wrote : Re: [Bug 38009] Re: Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Sorry, this seems to be something (slightly) different than bug
#33362
, I'm afraid. I'm using the latest Dapper already.

As I understand, bug #33362 refers to the fact that we should use
/var/run rather than /dev/shm. My bug report was meant to point out
that this transition is not handled cleanly by the postinst script.
The typical breezy installation will have a link
/etc/resolvconf/run -> /dev/shm/resolvconf *and* this link will be
canonicalisable at the time of the upgrade. Therefore, the postinst
script won't touch this link although it really should change it to
/var/run/resolvconf -- and rebuild this directory which is, as I
understand, taken care of by the initscript.

Sorry if I'm getting something wrong here.

Revision history for this message
Sebastian Kapfer (caci) wrote :

No, you're entirely correct, and I agree with you, see my comment in bug #33362. My patch works for new installations, it does not handle upgrades properly. I thought that upgrades didn't matter because the package was broken before anyway.

But there was a working version in Breezy, and we need to handle updates from that version.

My proposal for fixing this mess is the following:

* In the postinst script, find out whether or not we have a working "run" directory. If so, move its contents to /var/run/resolvconf so resolvconf keeps working until reboot. If no such directory exists, resolvconf was in a broken state and will only work after the next reboot (no regression).

* Unconditionally replace /etc/resolvconf/run by a symlink to /var/run/resolvconf.

* If /etc/resolv.conf is a symlink, replace by a symlink to /etc/resolvconf/run/resolv.conf. (This should be the case anyway, but let's play safe.)

* Stop supporting any other configuration but /etc/resolvconf/run being a symlink to /var/run/resolvconf. This removes a whole lot of logic from the maintainer scripts. /var/run is the only sensible solution with the Dapper boot sequence.

* If the "run" symlink has been changed from our default config, abort the init script, giving a useful error message which indicates that such a configuration is not supported.

Any comments?

Revision history for this message
Elias Oltmanns (oltmanns) wrote :

I generally feel a bit uneasy about changing things unconditionally,
perhaps even without notifying the admin. That's why my patch does
change the link without confirmation by the admin *only* if everything
seems to be untouched in breezy. Of course, we can drop this logic in
post dapper releases as Ubuntu only supports step-by-step upgrades.
However, I'd rather not touch configurations changed by the local
admin---or there should be some sort of appropriate notification, at least.

Revision history for this message
Sebastian Kapfer (caci) wrote : Revised version of Elias' patch

Further changes from your patch:

* I removed the creation of directories directly under /etc/resolvconf. Those won't be writable at boot time and have no merit.

* Killed off the whole /proc/mounts parsing. We know /var/run is on tmpfs after the next reboot.

* Try to keep resolvconf alive until reboot by placing a symlink to the old /dev/shm location.

If you don't have any objections, I think we can commit this.

Revision history for this message
Elias Oltmanns (oltmanns) wrote : Re: [Bug 38009] Re: Breezy -> Dapper transition needs proper /etc/resolvconf/run handling

Looks quite nice. Thanks.

Revision history for this message
Zak B. Elep (zakame) wrote :

I'd like the inputs of the MOTU reviewers before committing. =)

Thanks,

Changed in resolvconf:
assignee: zakame → motureviewers
Revision history for this message
Sebastian Dröge (slomo) wrote :

Looks fine to me, Zak... should be at least better than the current version :)

Revision history for this message
Zak B. Elep (zakame) wrote :

Thanks for everyone's inputs! =)

Changed in resolvconf:
status: Needs Info → Fix Committed
Zak B. Elep (zakame)
Changed in resolvconf:
status: Fix Committed → Fix Released
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.