diff --git a/usr/lib/python3.8/spoc/container.py b/usr/lib/python3.8/spoc/container.py index d45e831..d0dd482 100644 --- a/usr/lib/python3.8/spoc/container.py +++ b/usr/lib/python3.8/spoc/container.py @@ -194,8 +194,10 @@ class Container: def do_stop(self): # Stop the current container and wait until it stops completely - subprocess.Popen(['lxc-stop', '-P', config.CONTAINERS_DIR, self.name]) + lxc_stop = subprocess.Popen(['lxc-stop', '-P', config.CONTAINERS_DIR, self.name]) self.await_state(ContainerState.STOPPED) + # Reap the lxc-stop process + lxc_stop.wait() def execute(self, cmd, uid=None, gid=None, **kwargs): # If the container is starting or stopping, wait until the operation is finished