Comment 4 for bug 927300

Revision history for this message
Thomas Hood (jdthood) wrote : Re: upgrade from fresh/basic 11.10 to precise, resolveconf fails:cp: cannot create regular file `/run/resolvconf/resolv.conf': No such file or directory

The Debian policy scripture says: "When a package declaring a pre-dependency [in this case, resolvconf] is about to be unpacked the pre-dependency can be satisfied if the depended-on package [in this case, initscripts] is either fully configured, or even if the depended-on package(s) are only unpacked or in the "Half-Configured" state, provided that they have been configured correctly at some point in the past (and not removed or partially removed since)."

Does this mean that it is possible that resolvconf's preinst runs before initscripts's postinst on upgrade? It looks to me as if it does mean that.

Background: The resolvconf package creates run directories (/run/resolvconf/interface) in its preinst so that /sbin/resolvconf can be run even before resolvconf is configured. This sequence of events can and sometimes does occur when an admin does something like "apt-get install dnsmasq resolvconf"; in this case dnsmasq.postinst runs /sbin/resolvconf before resolvconf.postinst runs. This is supported.

In Debian, resolvconf does not Pre-Depend on anything because doing so is unnecessary, (apparently) insufficient and also bad form. Instead resolvconf.preinst creates a run directory in the best location available (viz., either in /run/ or in /lib/init/rw/) and resolvconf.postinst migrates the data to /run/resolvconf/ if it isn't there already. Debian resolvconf does things this way because only the postinst can take for granted that /run/ is available. Doing things this way does require that the old location (/lib/init/rw/) continues to be available until resolvconf.postinst runs; i.e., the old location is not eliminated until wheezy+1. I don't know whether or not Ubuntu has the corresponding luxury.
--
Thomas