Description: Cleanup partial container if -h was passed to template
 If user calls 'lxc-create -t ubuntu -- -h' (as opposed to
 'lxc-create -t ubuntu -h') then the ubuntu template will print its
 help then exit 0.  Then lxc-create does not cleanup.  So detect this
 in lxc-create.
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
Forwarded: yes
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1031043

Index: lxc-fix-seccomp/src/lxc/lxc-create.in
===================================================================
--- lxc-fix-seccomp.orig/src/lxc/lxc-create.in	2012-08-16 17:48:11.867917779 -0500
+++ lxc-fix-seccomp/src/lxc/lxc-create.in	2012-08-16 18:04:43.735900985 -0500
@@ -140,6 +140,18 @@
         esac
 done
 
+# If -h or --help was passed into the container, we'll want to cleanup
+# afterward
+wantedhelp=0
+for var in "$@"
+do
+if [ "$var" = "-h" -o "$var" = "--help" ]; then
+    help
+    exit 1
+fi
+done
+
+
 if [ -z "$lxc_path" ]; then
     echo "no configuration path defined !"
     exit 1
