X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver-build.functions;h=f94a6aac508c5ea72759aeecf447a90d60625bdc;hb=bea2fe0cd0b83cad13ec38db3f93f9d4c782f4c6;hp=3508f3f43e78d9343492adfab2b389b3a94a08e3;hpb=8314751ea70853c629cbfc1c8f3ce2ea9647de3f;p=util-vserver.git diff --git a/scripts/vserver-build.functions b/scripts/vserver-build.functions index 3508f3f..f94a6aa 100644 --- a/scripts/vserver-build.functions +++ b/scripts/vserver-build.functions @@ -256,3 +256,22 @@ function base.setSuccess { __BASE_SUCCESS=1 } + +function startSleepingGuest +{ + local guest="$1" + local timeout="$2" + $_VSERVER "$guest" start --rescue --rescue-init bash -c " + exec > /dev/null + exec 2> /dev/null + sleep $timeout + kill -s 15 -- -1 + sleep 1 + kill -s 9 -- -1" +} + +function stopSleepingGuest +{ + local guest="$1" + $_VSERVER "$guest" stop --rescue-init +}