From: Daniel Hokka Zakrisson Date: Sat, 21 Apr 2007 14:06:26 +0000 (+0000) Subject: Use the state change helper to stop the guest when the last process exits. X-Git-Tag: release-0.30.214~72 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83ae9431d6b0da8e156e27b8cebce98e168d30a0;p=util-vserver.git Use the state change helper to stop the guest when the last process exits. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2533 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/lib/cflags-v13.c b/lib/cflags-v13.c index e9c6a9d..2329ca0 100644 --- a/lib/cflags-v13.c +++ b/lib/cflags-v13.c @@ -68,7 +68,7 @@ static struct Mapping_uint64 const VALUES[] = { // Some pseudo flags DECL("secure", VC_VXF_HIDE_NETIF), - DECL("default", VC_VXF_VIRT_UPTIME), + DECL("default", VC_VXF_VIRT_UPTIME|VC_VXF_SC_HELPER), // Aliases for the legacy flags DECL("info_lock", VC_VXF_INFO_LOCK), diff --git a/scripts/vshelper b/scripts/vshelper index 7a7b2d4..0b44e22 100755 --- a/scripts/vshelper +++ b/scripts/vshelper @@ -80,6 +80,10 @@ function doInternalMethod exit 0 ;; (restart2) ;; + (shutdown) + logging $"Cleaning up after vserver '$VSERVER'" + spawn $_VSERVER --defaulttty "$VSERVER" stop + ;; (*) warning $"Unknown action '$ACTION' for vserver '$VSERVER'" exit 1 @@ -178,7 +182,7 @@ while true; do responsible_xid=$pxid done -vserver_id=$($_VSERVER_INFO "$responsible_xid" ID) || +vserver_id=$($_VSERVER_INFO "$responsible_xid" ID) || test "$ACTION" = "shutdown" || panic $"No responsible vserver found for xid '$responsible_xid' ($XID); aborting..." test "$XID" = "$responsible_xid" || {