<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>119940</bug_id>
          
          <creation_ts>2006-01-22 08:44 0000</creation_ts>
          <short_desc>catalyst: Couldn&apos;t umount one or more bind-mounts; aborting for safety.</short_desc>
          <delta_ts>2006-04-04 04:25:52 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Hosted Projects</product>
          <component>Catalyst</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>InCVS</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>pookey@pookey.co.uk</reporter>
          <assigned_to>catalyst@gentoo.org</assigned_to>
          <cc>ian_m_reed@hotmail.com</cc>
    
    <cc>rajiv@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>pookey@pookey.co.uk</who>
            <bug_when>2006-01-22 08:44:29 0000</bug_when>
            <thetext>I&apos;m getting the error below trying to build a livecd, the only alteration I&apos;ve made in the specfile it to add debootstrap and rsync.  This error is mentioned on the forum, but there&apos;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 &quot;/bin/bash /usr/lib/catalyst/targets/livecd-stage1/livecd-stage1.sh preclean&quot;
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 &quot;/bin/bash /usr/lib/catalyst/targets/support/kill-chroot-pids.sh&quot;

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&apos;t umount one or more bind-mounts; aborting for safety.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-01-22 10:59:11 0000</bug_when>
            <thetext>What version of catalyst is this with?  Have you tried 2.0_rc20?  The catalyst 1.x series isn&apos;t going to have any new code written for it, so please check that 2.0_rc20 doesn&apos;t solve this.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pookey@pookey.co.uk</who>
            <bug_when>2006-01-23 05:03:41 0000</bug_when>
            <thetext>I just tried with version 2.0_rc20....

# catalyst2 -f livecd-stage1_template.spec
.... 
&gt;&gt;&gt; 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&apos;t umount bind mount: /var/tmp/catalyst2/tmp/default/livecd-stage1-x86-20060122//dev

!!! catalyst: Couldn&apos;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!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rajiv@gentoo.org</who>
            <bug_when>2006-01-25 07:44:54 0000</bug_when>
            <thetext>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
/                  
&gt;&gt;&gt; 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=&quot;amd64&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -march=opteron -pipe -fomit-frame-pointer -ftracer&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2 -march=opteron -pipe -fomit-frame-pointer -ftracer&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig distlocks sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://mirror http://distfiles.gentoo.org&quot;
MAKEOPTS=&quot;-j5&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://mirror/gentoo-portage&quot;
USE=&quot;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&quot;
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY



</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ian_m_reed@hotmail.com</who>
            <bug_when>2006-01-31 08:46:32 0000</bug_when>
            <thetext>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 &quot;Couldn&apos;t umount...&quot; message and catalyst stops.

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

to:
warn(&quot;First attempt to unmount: &quot;+mypath+x+&quot; failed.&quot;)
warn(&quot;Killing any pids still running in the chroot&quot;)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-02-01 13:06:19 0000</bug_when>
            <thetext>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&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ian_m_reed@hotmail.com</who>
            <bug_when>2006-02-02 01:18:18 0000</bug_when>
            <thetext>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&apos;t noticed that there was a /usr/lib/catalyst2 directory tree...

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-02-02 05:34:30 0000</bug_when>
            <thetext>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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-02-02 06:26:00 0000</bug_when>
            <thetext>In 2.0_rc29</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>joao.brazio@solvay.com</who>
            <bug_when>2006-04-04 04:25:52 0000</bug_when>
            <thetext>Created an attachment (id=83873)
Fixes the catalyst 1.1.10.10 unbind &quot;ouch&quot; bug

</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>83873</attachid>
            <date>2006-04-04 04:25 0000</date>
            <desc>Fixes the catalyst 1.1.10.10 unbind &quot;ouch&quot; bug</desc>
            <filename>catalyst-1.1.10.10-unbindfix.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC91c3IvbGliL2NhdGFseXN0L21vZHVsZXMvZ2VuZXJpY19zdGFnZV90YXJnZXQucHkJMjAw
Ni0wNC0wNCAxMTozNTo0OC4wMDAwMDAwMDAgKzAxMDAKKysrIGdlbmVyaWNfc3RhZ2VfdGFyZ2V0
LnB5CTIwMDYtMDQtMDQgMTE6Mzg6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0zMDIsNiArMzAyLDgg
QEAKIAkJCQkgICAgb3VjaD0xCiAJCQkJICAgIHdhcm4oIkNvdWxkbid0IHVtb3VudCBiaW5kIG1v
dW50OiAiK215cGF0aCt4KQogCQkJCSAgICAjIGtlZXAgdHJ5aW5nIHRvIHVtb3VudCB0aGUgb3Ro
ZXJzLCB0byBtaW5pbWl6ZSBkYW1hZ2UgaWYgZGV2ZWxvcGVyIG1ha2VzIGEgbWlzdGFrZQorCQkJ
CWVsc2U6CisJCQkJICAgIG91Y2g9MAogCiAJCWlmIG91Y2g6CiAJCQkiIiIKCi0tLSAvdXNyL2xp
Yi9jYXRhbHlzdC90YXJnZXRzL3N1cHBvcnQva2lsbC1jaHJvb3QtcGlkcy5zaCAgICAgICAyMDA2
LTA0LTA0IDExOjM1OjQ4LjAwMDAwMDAwMCArMDEwMAorKysga2lsbC1jaHJvb3QtcGlkcy5zaCAy
MDA2LTA0LTA0IDExOjM4OjA3LjAwMDAwMDAwMCArMDEwMApAQCAtNTYsMyArNTYsNSBAQAogICAg
ICAgICAgICBraWxsIC05ICR7cGlkfQogICAgIGRvbmUKIGZpCisKK3NsZWVwIDEwCgo=
</data>        

          </attachment>
    </bug>

</bugzilla>