When mount phase fails, pbuilder unmount directories of other chroots

Bug #1156636 reported by Jean-Baptiste Lallement
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pbuilder (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When the mount phase of pbuilder fails, pbuilder umounts directories that have already been successfully mounted (/usr/lib/pbuilder/pbuilder-modules lines 273 - 291) but it uses the device name (name of the directory being bind mounted) instead of the name of the mount point.

If the directory is bind-mounted several times in others, unrelated, chroots it tries to unmount all of them.

For example (full log attached) on the log below note that PIDs in cow.<PID> are different:

I: umounting /var/lib/jenkins/cu2d
umount: /var/cache/pbuilder/build/cow.15281/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1195/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1197/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.1739/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.59368/var/lib/jenkins/cu2d: not mounted
umount: /var/cache/pbuilder/build/cow.53454/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.36950/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /var/cache/pbuilder/build/cow.19691/var/lib/jenkins/cu2d: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

line 278 of /usr/lib/pbuilder/pbuilder-modules could use the full path of the mount point:
mounted[${#mounted[@]}]="$BUILDPLACE/$mnt"

instead of $mnt only.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: pbuilder 0.213ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-12.21-generic 3.8.2
Uname: Linux 3.8.0-12-generic x86_64
ApportVersion: 2.9.1-0ubuntu1
Architecture: amd64
Date: Mon Mar 18 15:24:51 2013
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: pbuilder
UpgradeStatus: Upgraded to raring on 2012-01-31 (411 days ago)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
description: updated
Changed in pbuilder (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Mattia Rizzolo (mapreri) wrote :
Changed in pbuilder (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pbuilder - 0.225

---------------
pbuilder (0.225) unstable; urgency=medium

  [ Mattia Rizzolo ]
  * debian/rules:
    + change default ubuntu distribution to yakkety.
    + enable universe by default in Ubuntu. LP: #237591
  * Add builtin eatmydata support (Closes: #606158)
  * Add a USESYSFS option (defaulting to yes) to mount a sysfs filesystem in
    /sys. Closes: #773767
  * Strip leading path from when calling external programs. They are all in
    PATH, so let the shell finding them instead of calling them directly with
    the full path, so exiting things can be done. Closes: #635698
  * modules:
    + take care of saving the mount point instead of the device name when
      bind-mounting. This avoids umounting of unrelated mount points in case
      of errors. LP: #1156636
    + support specifying BINDMOUNTS destination. Thanks to Austin Phillips
      <email address hidden> for the initial patch. Closes: #593100
    + for selinux, only check for the precense of the selinux mount, instead of
      using selinuxenabled. Closes: #506917
    + in the help message be more clear about what the `execute` command is for.
      Closes: #805494
  * pbuilder.8: use BUILDDIR instead of the old /tmp/buildd.
  * create/update:
    + move the code picking extra packages to install for optional features in
      a common function in modules.
  * checkparams: add a "--use-network yes|no" cmdline flag. Closes: #823408
  * satisfydepends-funcs:
    + nicer formatting of the --help output, with a "Debugging options" section.
    + document the --internal-chrootexec option. Closes: #635697

  [ James Clarke ]
  * pdebuild: fix typo in error message (debsign, not debsing).
  * modules:
    + pass -q, -y and APTGETOPT to apt-get in remove_packages.
    + add linsysfs support for KFreeBSD.

 -- Mattia Rizzolo <email address hidden> Sun, 12 Jun 2016 12:50:16 +0000

Changed in pbuilder (Ubuntu):
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.