[Lxc-users] [PATCH 9/9] lxc-destroy: wait until the container is stopped

Serge Hallyn serge at hallyn.com
Thu Apr 26 05:09:41 UTC 2012


From: Serge Hallyn <serge.hallyn at ubuntu.com>

Author: Timothy Chen <tnachen at gmail.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/980902

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Cc: Timothy Chen <tnachen at gmail.com>
---
 src/lxc/lxc-destroy.in |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in
index b0f2da5..17fa6d6 100644
--- a/src/lxc/lxc-destroy.in
+++ b/src/lxc/lxc-destroy.in
@@ -87,6 +87,7 @@ lxc-info -n $lxc_name 2>/dev/null | grep -q RUNNING
 if [ $? -eq 0 ]; then
 	if [ $force -eq 1 ]; then
 		lxc-stop -n $lxc_name
+		lxc-wait -n $lxc_name -s STOPPED
 	else
 		echo "Container $lxc_name is running, aborting the deletion."
 		exit 1
-- 
1.7.9.5





More information about the lxc-users mailing list