From 71f07edd672a9d05f8ddb68d674f4f8811fec9a1 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 3 Oct 2017 19:13:31 +0100 Subject: Use a network namespace for builds --- lib/Iurt/Chroot.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Iurt') diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 362c7e7..ea26655 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -238,6 +238,8 @@ 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"); @@ -313,6 +315,10 @@ sub create_build_chroot { } } } + + if ($ret) { + sudo($config, '--netns_create', $chroot); + } return $ret; } -- cgit v1.2.1