aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--lib/Iurt/Chroot.pm8
2 files changed, 4 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 08bc45b..2075cc1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- ulri: ignore failures when cancelling build
+- iurt: kill processes before unmounting in clean_chroot
0.7.7
- ulri: only use mandatory archs for noarch builds
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index 480fae4..1427aa3 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -33,6 +33,8 @@ sub clean_chroot {
plog('DEBUG', "clean chroot");
if (-d $chroot) {
+ # This also kills any process in the associated namespace
+ sudo($config, '--netns_delete', $chroot);
_clean_mounts($run, $config, $chroot);
# Do not run rm if there is something still mounted there
@@ -230,7 +232,7 @@ sub clean_all_chroot_tmp {
}
foreach (readdir($dir)) {
/$prefix/ or next;
- delete_chroot($run, $config, "$chroot_dir/$_");
+ clean_chroot($run, $config, "$chroot_dir/$_");
}
closedir $dir;
}
@@ -238,10 +240,6 @@ sub clean_all_chroot_tmp {
sub delete_chroot {
my ($run, $config, $chroot) = @_;
- # This also kills any process in the associated namespace
- sudo($config, '--netns_delete', $chroot);
- _clean_mounts($run, $config, $chroot);
-
plog(1, "cleaning $chroot");
# Needs to be added to iurt_root_command
# system("$sudo /sbin/fuser -k $chroot &> /dev/null");