}
}
-function _setVserverDir
+function _setVserverDirName
{
test -z "$VSERVERDIRNAME" || return 0
VSERVERDIRNAME="$VSERVER_NAME"
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
{
_setRootDir
_setCacheDir
- _setVserverDir
+ _setVserverDirName
_setVdir
findFile _DEV_FILE "$__CONFDIR/.distributions/$DISTRIBUTION/devs" "$__DISTRIBDIR/$DISTRIBUTION/devs" "$__DISTRIBDIR/defaults/devs"
{
__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
+}