aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Chroot.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-10-15 19:31:31 +0000
committerPascal Terjan <pterjan@mageia.org>2018-10-16 08:53:07 +0000
commit69e74732d254c75adc20afc25a8729ca568be832 (patch)
treeb68873345ec572d52605d37108ca7a7e19849774 /lib/Iurt/Chroot.pm
parent3a962ef8766b0a735b8491f40f34d31e9a6c3bb7 (diff)
downloadiurt-69e74732d254c75adc20afc25a8729ca568be832.tar
iurt-69e74732d254c75adc20afc25a8729ca568be832.tar.gz
iurt-69e74732d254c75adc20afc25a8729ca568be832.tar.bz2
iurt-69e74732d254c75adc20afc25a8729ca568be832.tar.xz
iurt-69e74732d254c75adc20afc25a8729ca568be832.zip
Kill processes before unmounting in clean_chroot
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r--lib/Iurt/Chroot.pm8
1 files changed, 3 insertions, 5 deletions
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");