From f64dbf290eb891ebee9b40eabd5240d15a873568 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Fri, 6 Apr 2012 11:13:19 +0200 Subject: [PATCH] Cleanup cgroup when guest start fails --- scripts/vserver.start | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" -- 1.8.1.5