From: Daniel Hokka Zakrisson Date: Fri, 6 Apr 2012 09:13:19 +0000 (+0200) Subject: Cleanup cgroup when guest start fails X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f64dbf290eb891ebee9b40eabd5240d15a873568;p=util-vserver.git Cleanup cgroup when guest start fails --- diff --git a/scripts/vserver.start b/scripts/vserver.start index 7cdf63b..40693c6 100644 --- a/scripts/vserver.start +++ b/scripts/vserver.start @@ -60,6 +60,7 @@ Failed to start vserver '$VSERVER_NAME'" test -n "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null test -z "$is_mounted" || umountVserver "$VSERVER_DIR" || : test -z "$have_interfaces" || disableInterfaces "$VSERVER_DIR" || : + test -z "$have_cgroup" || destroyCgroup "$VSERVER_DIR" || : unlock || : } @@ -72,6 +73,7 @@ is_vshelper_init= have_interfaces= startsync_pipe= have_initcmd= +have_cgroup= while test "$#" -gt 0; do case "$1" in @@ -121,7 +123,7 @@ enableInterfaces "$VSERVER_DIR" && have_interfaces=1 mountVserver "$VSERVER_DIR" && is_mounted=1 prepareInit "$VSERVER_DIR" addtoCPUSET "$VSERVER_DIR" -attachToCgroup "$VSERVER_DIR" +attachToCgroup "$VSERVER_DIR" && have_cgroup=1 handleDeviceMap --set "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"