From 10ee05c7e767344f9c263616ae45b3ff85317797 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 3 Nov 2008 19:52:53 +0000 Subject: [PATCH] Enter the spaces when migrating to an existing static context. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2821 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/chcontext | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/chcontext b/scripts/chcontext index fda3e01..d30f645 100755 --- a/scripts/chcontext +++ b/scripts/chcontext @@ -172,7 +172,12 @@ migrate_cmd=( $_VCONTEXT IFS=$old_IFS -if test -z "$OPT_CTX" || $_VSERVER_INFO -q "$OPT_CTX" XIDTYPE static; then +$_VSERVER_INFO -q "$OPT_CTX" XIDTYPE static +is_static=$? +test -z "$OPT_CTX" +is_dynamic=$? + +if test "$is_dynamic" -eq 0 || test "$is_static" -eq 0; then "${create_cmd[@]}" "${chain_cmd[@]}" -- \ "${migrate_cmd[@]}" --endsetup --migrate-self -- "$@" rc=$? @@ -180,6 +185,13 @@ else rc=254 fi -test "$rc" -ne 254 || exec "$_VTAG" --migrate --tag "$OPT_CTX" --silent -- \ - "${migrate_cmd[@]}" --xid "$OPT_CTX" --migrate -- "$@" +if test "$is_static" -eq 0; then + migrate_cmd=( $_VTAG --migrate --tag "$OPT_CTX" --silent -- \ + $_VSPACE --enter "$OPT_CTX" $OPT_SPACES -- \ + "${migrate_cmd[@]}" ) +fi + + +test "$rc" -ne 254 || exec "${migrate_cmd[@]}" --xid "$OPT_CTX" --migrate -- \ + "$@" exit $rc -- 1.8.1.5