[Grml] [PATCH] grml-chroot enhance: fail-safe when umount fails
Michael Gebetsroither
gebi at sbox.tugraz.at
Tue Jun 8 16:36:11 CEST 2010
Tong Sun wrote:
> Revisiting an old issue.
>
> On Sat, Nov 29, 2008 at 11:11 AM, Michael Gebetsroither
> <gebi at sbox.tugraz.at <mailto:gebi at sbox.tugraz.at>> wrote:
>
> Tong Sun wrote:
>
> NACK as this causes problems with multiple grml-chroots running.
>
> > ---
> > usr_sbin/grml-chroot | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot
> > index eb9cefc..bce9c50 100755
> > --- a/usr_sbin/grml-chroot
> > +++ b/usr_sbin/grml-chroot
> > @@ -56,7 +56,7 @@ function mountit
> > function umount_all
> > {
> > for i in $MOUNTED_; do
> > - umount "${DEST_}/$i"
> > + umount "${DEST_}/$i" || umount -l "${DEST_}/$i"
> > done
> > }
> >
>
>
> In this case, the sentence in man, "After COMMAND exits, mounts are
> cleaned up properly." might not be always correct.
Right, it's not entirely correct. If you close multiple grml-chroot
instances in the wrong order you will experience mountpoints from
grml-chroot not cleand up. And get the appropriate error messages.
Though your patch destroys _every_ other grml-chroot instance running in
parallel because you just unmount filesystems which are in use.
greets,
michael
More information about the Grml
mailing list