use sane PATH during shutdown
[util-vserver.git] / scripts / vserver-build.functions
index b970823..f94a6aa 100644 (file)
@@ -183,6 +183,8 @@ ERROR: Can not determine distribution; please specify it manually with
 ERROR: Can not find configuration for the distribution '$DISTRIBUTION';
   please read http://linux-vserver.org/HowToRegisterNewDistributions
   for information how to add support for your own distribution."
+
+    export DISTRIBUTION
 }
 
 function base._addGeneratedFile
@@ -254,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
+}