X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver-build.functions;h=7e26efdb4262e05c04001358e9645dcfefb6ca57;hb=347f2ee1ef3af508bd1b7c78f3b428dbea4326e6;hp=2f22192e93c75351092963a10be356e68cc0c749;hpb=d51ba756dbbd229a05b6bd919fdc413ab5c57fd5;p=util-vserver.git diff --git a/scripts/vserver-build.functions b/scripts/vserver-build.functions index 2f22192..7e26efd 100644 --- a/scripts/vserver-build.functions +++ b/scripts/vserver-build.functions @@ -44,6 +44,9 @@ function makeDevEntry (f) touch "$dst" chmod $4 "$dst" ;; + (l) ln -s "$4" "$dst" + test -z "$5" || chmod "$5" "$dst" + ;; (*) echo "Unknown dev-entry mode '$3'" >&2 false ;; @@ -264,12 +267,16 @@ function base.setSuccess function startSleepingGuest { local guest="$1" - local timeout="$2" + local timeout="${2:-15}" $_VSERVER "$guest" start --rescue --rescue-init bash -c " exec > /dev/null exec 2> /dev/null trap 'kill -s 9 -- -1; exit 0' INT - sleep $timeout + i=0 + while [ \$i -lt $timeout ]; do + sleep 1 + let ++i + done kill -s 15 -- -1 sleep 1 kill -s 9 -- -1" @@ -278,5 +285,5 @@ function startSleepingGuest function stopSleepingGuest { local guest="$1" - $_VKILL --xid "$guest" -s INT -- 1 + $_VSERVER "$guest" stop --rescue-init }