From f4cd3076f00884833aff775414c1132237be922e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 23 Oct 2014 00:21:03 +0200 Subject: try harder to umount everything when sg went havroc --- perl-install/install/NEWS | 1 + tools/drakx-in-chroot | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index b76115f30..0f741f8a3 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,6 +1,7 @@ - drakx-in-chroot: o document --stage2-update in --help o mount /dev -o ro + o try harder to umount everything when sg went havroc Version 16.43 - 20 October 2014 diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot index e289ebbaf..dbc319052 100755 --- a/tools/drakx-in-chroot +++ b/tools/drakx-in-chroot @@ -56,6 +56,9 @@ if ($>) { $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; } +my @mounts; +my $_b = before_leaving { sys("$sudo umount $_") foreach reverse @mounts }; + undef $ENV{TMPDIR}; # prevent packdrake faillure on creating temporary files if (-d $SLASH_LOCATION) { @@ -200,6 +203,7 @@ sub create_initial_symlinks() { sub mount { my ($from, $mntpt, @opts) = @_; + push @mounts, $mntpt; sys("$sudo mount $from $mntpt " . join(' ', @opts)); } -- cgit v1.2.1