Native Multistrap oneiric chroots have an error configuring base-files

Bug #874505 reported by Wookey on 2011-10-14
56
This bug affects 12 people
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
Undecided
Wookey

Bug Description

Setting up an Oneiric cross-build chroot on a natty machine with the natty version of multistrap dies during base-files due to /var/run issue:

Setting up base-files (6.4ubuntu5) ...
rmdir: failed to remove `/var/run': Directory not empty
dpkg: error processing base-files (--configure):
 subprocess installed post-installation script returned error exit status 1

thjis goes on to prevent installation of:
 base-files
 bash
 dpkg-dev
 devscripts
 libdebian-dpkgcross-perl
 xdeb
 build-essential
 dpkg-cross

Inside the schroot we have:
/var/run on /run type none (rw,bind)
/var/lock on /run/lock type none (rw,bind)

umounting these does not allow /var/run migration because now some files have already been created in there:
sudo dpkg --configure -a
Setting up base-files (6.4ubuntu5) ...
rmdir: failed to remove `/var/run': Directory not empty

Wookey (wookey) on 2011-10-14
affects: ubuntu → multistrap (Ubuntu)
Changed in multistrap (Ubuntu):
assignee: nobody → Wookey (wookey)
status: New → Confirmed
Faisal Humayun (faisal-humayun) wrote :

Duplicated problem.
Additional Info:

dpkg --configure -a
Setting up base-files (6.4ubuntu5) ...
+ [ ! -e /etc/dpkg/origins/default ]
+ [ configure = configure ]
+ [ = ]
+ install_from_default /usr/share/base-files/nsswitch.conf /etc/nsswitch.conf
+ [ ! -f /etc/nsswitch.conf ]
+ install_from_default /usr/share/base-files/dot.profile /root/.profile
+ [ ! -f /root/.profile ]
+ install_from_default /usr/share/base-files/dot.bashrc /root/.bashrc
+ [ ! -f /root/.bashrc ]
+ install_from_default /usr/share/base-files/profile /etc/profile
+ [ ! -f /etc/profile ]
+ install_from_default /usr/share/base-files/networks /etc/networks
+ [ ! -f /etc/networks ]
+ install_directory srv 755 root
+ [ ! -d /srv ]
+ install_directory opt 755 root
+ [ ! -d /opt ]
+ install_directory etc/opt 755 root
+ [ ! -d /etc/opt ]
+ install_directory var/opt 755 root
+ [ ! -d /var/opt ]
+ install_directory media 755 root
+ [ ! -d /media ]
+ install_directory var/mail 2775 mail
+ [ ! -d /var/mail ]
+ [ ! -L /var/spool/mail ]
+ install_directory run/lock 1777 root
+ [ ! -d /run/lock ]
+ migrate_directory /var/run /run
+ [ ! -L /var/run ]
+ rmdir /var/run
rmdir: failed to remove `/var/run': Directory not empty
dpkg: error processing base-files (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 base-files

Hector Oron (zumbi) wrote :

Hello,

  You might want to reassign this bug to `base-files' package as it seems a bug that belongs to that package.

  A suggested tested fix follows up, thanks to Helio de Castro:

  --- base-files-6.5ubuntu3/debian/postinst.in 2011-07-13 17:20:35.000000000 -0300
+++ helio-base/debian/postinst.in 2012-01-23 15:07:18.150498042 -0200
@@ -25,6 +25,13 @@

 migrate_directory() {
   if [ ! -L $1 ]; then
+ if [ ! -z "`ls -A $1/`" ]; then
+ for x in $1/* $1/.[!.]* $1/..?*; do
+ if [ -e "$x" ]; then
+ mv -- "$x" $2/
+ fi
+ done
+ fi
     rmdir $1
     ln -s $2 $1
   fi

Best regards
  -- Hector Oron

Hector Oron (zumbi) wrote :

Adding patch as attachment as copy&paste breaks the white spaces.

Cheers

The attachment "base-files-6.5-postint.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Hector Oron (zumbi) wrote :

This bug seems to affect precise as well.

It has also been reported to affect Debian/wheezy.

It is really a bug on base-files postinst.

Cheers

Wookey (wookey) wrote :

This is actually a problem in base-files, now reprpoduced in precise and wheezy

affects: multistrap (Ubuntu) → base-files (Ubuntu)
Wookey (wookey) wrote :

base-files postinst expects /var/run to be empty and fails if it isn't.
Presumably something about debootstrap makes sure base-files gets configured before any other package has managed to populate /var/run Multistrap makes no such guarantee. hector's patch fixes this case and should make things more robust generally.

Aoshi (aoshi) wrote :

Is there any status on this problem? A patch was provided almost half a year ago. Also, this patch didn't made it into Quantal as of now. I cannot find any bug reports about this problem on debian and I can also install wheezy just fine with it but I am unable to install ubuntu precise (haven't tested quantal as i don't need this, lucid and oneiric works) .

Mikko Rapeli (mikko-rapeli) wrote :

This is still affecting precise. Any plans to backport a fix?

Guido Nickels (gsn) wrote :

Also affects xenial.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers