Description: Make lxc-destroy wait until the container is stopped
Author: Timothy Chen <tnachen@gmail.com>
Forwarded: no
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/980902

Index: lxc-0.7.5/src/lxc/lxc-destroy.in
===================================================================
--- lxc-0.7.5.orig/src/lxc/lxc-destroy.in	2012-04-16 12:01:07.366127044 -0500
+++ lxc-0.7.5/src/lxc/lxc-destroy.in	2012-04-16 12:01:56.150126218 -0500
@@ -86,6 +86,7 @@
 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
