Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119940 - catalyst: Couldn't umount one or more bind-mounts; aborting for safety.
Summary: catalyst: Couldn't umount one or more bind-mounts; aborting for safety.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-01-22 08:44 UTC by Ian P. Christian
Modified: 2006-04-04 04:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes the catalyst 1.1.10.10 unbind "ouch" bug (catalyst-1.1.10.10-unbindfix.patch,620 bytes, patch)
2006-04-04 04:25 UTC, Joao BRAZIO
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian P. Christian 2006-01-22 08:44:29 UTC
I'm getting the error below trying to build a livecd, the only alteration I've made in the specfile it to add debootstrap and rsync.  This error is mentioned on the forum, but there's an answer to the problem there.

Thanks!


# catalyst -f livecd-stage1-minimal.spec

 * Regenerating GNU info directory index...
 * Processed 95 info files.
Running action sequence: preclean
Running command "/bin/bash /usr/lib/catalyst/targets/livecd-stage1/livecd-stage1.sh preclean"
Running action sequence: unbind
umount: /var/tmp/catalyst/tmp/default/livecd-stage1-x86-20060120/dev: device is busy
umount: /var/tmp/catalyst/tmp/default/livecd-stage1-x86-20060120/dev: device is busy
!!! catalyst: First attempt to unmount: /var/tmp/catalyst/tmp/default/livecd-stage1-x86-20060120/dev failed.
!!! catalyst: Killing any pids still running in the chroot
Checking for processes running in chroot and killing them.
Running command "/bin/bash /usr/lib/catalyst/targets/support/kill-chroot-pids.sh"

Killing process(es)
pid: process name
21734: /var/tmp/catalyst/tmp/default/livecd-stage1-x86-20060120/sbin/udevd

Press Ctrl-C within 10 seconds to abort

!!! catalyst: Couldn't umount one or more bind-mounts; aborting for safety.
Comment 1 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-22 10:59:11 UTC
What version of catalyst is this with?  Have you tried 2.0_rc20?  The catalyst 1.x series isn't going to have any new code written for it, so please check that 2.0_rc20 doesn't solve this.
Comment 2 Ian P. Christian 2006-01-23 05:03:41 UTC
I just tried with version 2.0_rc20....

# catalyst2 -f livecd-stage1_template.spec
.... 
>>> No outdated packages were found on your system.


 * Regenerating GNU info directory index...
 * Processed 95 info files.
removing /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/tmp/chroot-functions.sh from the chroot
Running action sequence: unbind
umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
!!! catalyst: First attempt to unmount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122//dev failed.
!!! catalyst: Killing any pids still running in the chroot
Checking for processes running in chroot and killing them.

Killing process(es)
pid: process name
8689: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/sbin/udevd

Press Ctrl-C within 10 seconds to abort
umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
!!! catalyst: Couldn't umount bind mount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122//dev

!!! catalyst: Couldn't umount one or more bind-mounts; aborting for safety.

umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
umount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122/dev: device is busy
/dev is still mounted; performing auto-bind-umount... !!! catalyst: First attempt to unmount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122//dev failed.
!!! catalyst: Killing any pids still running in the chroot
Checking for processes running in chroot and killing them.
Auto-unbind successful...

Catalyst aborting....




Thanks again!
Comment 3 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2006-01-25 07:44:54 UTC
i am seeing similar errors while building a stage 4. however, my build completes successfully. looks like udevd in the chroot never exits.

...
Running post-kmerge.sh in chroot /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1
/                  
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies ...                                                           [ ok ]
removing /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/chroot-functions.sh from the chroot   
Running action sequence: bootloader
Running action sequence: root_overlay
Running action sequence: fsscript
Running action sequence: preclean
copying stage4-preclean-chroot.sh to /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/          
copying chroot-functions.sh to /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/                
Running stage4-preclean-chroot.sh in chroot /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/       
removing /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/chroot-functions.sh from the chroot   
Running action sequence: rcupdate
copying rc-update.sh to /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/
copying chroot-functions.sh to /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/                
Running rc-update.sh in chroot /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/
removing /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/tmp/chroot-functions.sh from the chroot   
Running action sequence: unmerge
Running action sequence: unbind
umount: /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/dev: device is busy
umount: /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/dev: device is busy
!!! catalyst: First attempt to unmount: /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1//dev failed.
!!! catalyst: Killing any pids still running in the chroot
Checking for processes running in chroot and killing them.
                   
Killing process(es)
pid: process name  
17013: /brontes/installer/catalyst/tmp/workstation/stage4-amd64-20060124.1/sbin/udevd
                   
Press Ctrl-C within 10 seconds to abort
Running action sequence: remove
Running action sequence: empty
Running action sequence: clean
Cleaning chroot: /var/tmp/*...
Cleaning chroot: /tmp/*...
Running action sequence: capture
Creating stage tarball...
MD5 (/brontes/installer/catalyst/builds/workstation/stage4-amd64-20060124.1.tar.bz2) = 1785a85b6fe00e301c46460e062af46a
SHA1 (/brontes/installer/catalyst/builds/workstation/stage4-amd64-20060124.1.tar.bz2) = fa88f95995028fbeb5dda9df80e18ffed918646e
Running action sequence: clear_autoresume
Removing AutoResume Points: ...
Emptying directory /brontes/installer/catalyst/tmp/workstation/.autoresume-stage4-amd64-20060124.1/
                   

on the machine running catalyst: dev-util/catalyst-2.0_rc20, sys-fs/udev-079-r1


Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.15-rc6 x86_64)
=================================================================
System uname: 2.6.15-rc6 x86_64 Dual Core AMD Opteron(tm) Processor 275
Gentoo Base System version 1.6.14
ccache version 2.3 [disabled]
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=opteron -pipe -fomit-frame-pointer -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=opteron -pipe -fomit-frame-pointer -ftracer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror http://distfiles.gentoo.org"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror/gentoo-portage"
USE="amd64 alsa avi bash-completion bitmap-fonts bzip2 cdr crypt cups eds emboss encode expat foomaticdb fortran gdbm gif gnome gstreamer gtk gtk2 imlib jpeg lzw lzw-tiff mhash mp3 mpeg ncurses nptl nptlonly opengl openntpd pam pdflib perl png python quicktime readline sdl spell ssl tcpd tiff truetype-fonts type1-fonts udev usb userlocales xpm xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY



Comment 4 Ian Reed 2006-01-31 08:46:32 UTC
The problem is in the file modules/generic_stage_target.py and the def unbind(self) method.  This problem still exists in version 2.0_rc26.

If the umount fails then self.kill_chroot_pids() is called to try and free the mount point and umount is called again.  Good.

However, the variable ouch is also set to 1 and not cleared by a successful 2nd umount.  So, even if the 2nd umount succeeds we get the "Couldn't umount..." message and catalyst stops.

Probably the best solution is to change this block:
ouch=1
warn("First attempt to unmount: "+mypath+x+" failed.")
warn("Killing any pids still running in the chroot")

to:
warn("First attempt to unmount: "+mypath+x+" failed.")
warn("Killing any pids still running in the chroot")
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2006-02-01 13:06:19 UTC
Ian:  What youa re seeing is expected behavior.  If even after the second umount attempt the files are still in use, catalyst aborts.  As you can see from Rajiv's output in comment #3, if it fails on the first, it tries to kill the processes, then umount again, continuing until completion if the action is successful.
Comment 6 Ian Reed 2006-02-02 01:18:18 UTC
Ah I see it now,

There code in version 1 catalyst is definitely wrong.  ouch is set 1 if the first umount fails and never gets cleared if the 2nd umount succeeds.  I can see that the version 2 catalyst code is correct.

I had inadvertently made the fix in the version 1 catalyst file while running verion 2 because I hadn't noticed that there was a /usr/lib/catalyst2 directory tree...

Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2006-02-02 05:34:30 UTC
We added a 5 second sleep to the end of the kill-chroot-pids.sh script, so hopefully that should be enough to have any programs/daemons settle down and actually die before we attempt the second umount.
Comment 8 Chris Gianelloni (RETIRED) gentoo-dev 2006-02-02 06:26:00 UTC
In 2.0_rc29
Comment 9 Joao BRAZIO 2006-04-04 04:25:52 UTC
Created attachment 83873 [details, diff]
Fixes the catalyst 1.1.10.10 unbind "ouch" bug