Upgrade from fresh 11.10 to Precise: resolvconf 1.63ubuntu7 fails to install with "cp: cannot create regular file `/run/resolvconf/resolv.conf': No such file or directory"

Bug #927300 reported by Steve McInerney
0
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
Incomplete
Medium
Unassigned

Bug Description

Fresh install of 11.10.
Network upgrade to precise.

Setting up resolvconf (1.63ubuntu7) ...
cp: cannot create regular file `/run/resolvconf/resolv.conf': No such file or directory
dpkg: error processing resolvconf (--configure):
 subprocess installed post-installation script returned error exit status 1

Additional:
manually creating /run/resolvconf still fails:
Setting up resolvconf (1.63ubuntu7) ...
cp: cannot create regular file `/run/resolvconf/interface/original.resolvconf': No such file or directory

Steve McInerney (spm)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Steve,

This error should never happen, because resolvconf pre-depends on the version of initscripts that ensures /run is available. Can you show the /run directory from this system?

Changed in resolvconf (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Thomas Hood (jdthood) wrote :

Steve wrote in #1:
> This error should never happen, because resolvconf pre-depends on the version of initscripts that ensures /run is available.

Steve: If I understand the submitter correctly, he created /run/resolvconf manually and the install still failed. It failed because /run/resolvconf/interface/ was absent. So it seems that the code to create /run/resolvconf/ and /run/resolvconf/interface/ did not run successfully at the right time during the upgrade.

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

He said he manually created it *after* receiving a failure. But the failure itself should never occur from what I know of the code; the resolvconf package pre-depends on initscripts, so /var/run -> /run bind-mounting has already been dealt with before we unpack resolvconf, and then the resolvconf preinst runs:

case "$1" in
  install|upgrade)
        # Ensure that /run/resolvconf/interface exists.
        mkdir -p /run/resolvconf/interface

        ;;
  # abort-upgrade)

This should always trigger on an upgrade from oneiric. Hence, asking what the state of /run is on this system.

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

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

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 927300] 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

On Wed, Feb 08, 2012 at 11:16:18AM -0000, Thomas Hood wrote:
> 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.

No; it means that if a version of initscripts that satisfied the
pre-dependency had previously been configured, resolvconf may be unpacked
while initscripts is in an unconfigured state. But the ordering on upgrade
is guaranteed to be preserved.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

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

Ah, OK. Hmm, then I'm stumped too.

Steve McInerney: Yes, please let us know what's in your /run. Also send output of df. Also, you mention "manually creating /run/resolvconf". Was /run already there when you did that?

Revision history for this message
Steve McInerney (spm) wrote :

Sorry Gents, have been in upgrade hell on this cycle; that upgrade was wiped this morning.

To be clear:
mkdir /run/resolvconf <== is what I did
the directory /run/ already existed.

It was a completely fresh and barely used (login far enough to kick an upgrade to precise) 11.10 system.
specifically: ubuntu-11.10-desktop-i386.iso

The work around to successfully complete the configure of resolvconf was simply to mkdir those two missing directories.
mkdir /run/resolvconf
<try configure again, fail>
mkdir /run/resolvconf/interface
<configure completes>

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

Steve McInerney: Did you upgrade to Precise without rebooting first?

Revision history for this message
Steve McInerney (spm) wrote :

No.
heh, I think that would actually be a rather difficult thing to do as the installer basically forces a reboot on you. :-)

Actions were:
install 11.10 from usb-key onto system
pretty much accept the basic defaults the whole way.
reboot when prompted; remove usbkey.
fresh 11.10 up and working; login; kick off precise upgrade.

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

The discussion above about the sequencing of initscripts.postinst and resolvconf.preinst now seems to me to be irrelevant because the submitter upgraded from Oneiric which already has /run/. (The version of initscripts in Oneiric is 2.88dsf-13.10ubuntu4 which already satisfies resolvconf 1.63ubuntu7's predependency on 2.88dsf-13.10.)

I have just attempted to reproduce the failure. I installed 11.10 on a clean virtual machine, rebooted when told to do so, then upgraded to Precise using "update-manager -d". /run/ was already there, of course; resolvconf.preinst created /run/resolvconf/interface as expected; resolvconf.postinst then created /run/resolvconf/enable-updates, /run/resolvconf/resolv.conf and /run/resolvconf/interface/original.resolvconf as expected. No problem at all.

Dd you install network-manager before upgrading or something like that?

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

The submitter's system has been wiped and I couldn't reproduce the failure. For clues as to what caused the failure I guess we'll just have to wait for someone else to submit a report.

Thomas Hood (jdthood)
summary: - upgrade from fresh/basic 11.10 to precise, resolvconf fails: cp: cannot
- create regular file `/run/resolvconf/resolv.conf': No such file or
- directory
+ Upgrade from fresh 11.10 to Precise: resolvconf 1.63ubuntu7 fails to
+ install with "cp: cannot create regular file
+ `/run/resolvconf/resolv.conf': No such file or directory"
Revision history for this message
Thomas Hood (jdthood) wrote :

Steve McInerney: Is there any chance you rebooted somewhere during the upgrade to Precise? Not at the end when asked, but in the middle of the process, such that configuration had to be resumed after reboot.

Revision history for this message
Steve McInerney (spm) wrote : Re: [Bug 927300] Re: Upgrade from fresh 11.10 to Precise: resolvconf 1.63ubuntu7 fails to install with "cp: cannot create regular file `/run/resolvconf/resolv.conf': No such file or directory"

On 17/02/12 01:45, Thomas Hood wrote:
> *** This bug is a duplicate of bug 933035 ***
> https://bugs.launchpad.net/bugs/933035
>
> Steve McInerney: Is there any chance you rebooted somewhere during the
> upgrade to Precise? Not at the end when asked, but in the middle of the
> process, such that configuration had to be resumed after reboot.

My initial thought was no way; But I suppose it *is* possible, and I simply
don't recall having done so.
Apologies for the vagueness, I recognise how frustrating that is.

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.