X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvserver.functions;h=be47739f10d09480841d991b59a7b6231eb036db;hb=de564920ce902dbdbaf93f6bf0fe00f385cbe071;hp=6b7bf4553c9e66c688495f49c4a88f0d218c5709;hpb=de2ee1bbfe9ec1f75172aac6022e8dd9938572ea;p=util-vserver.git diff --git a/util-vserver/scripts/vserver.functions b/util-vserver/scripts/vserver.functions index 6b7bf45..be47739 100644 --- a/util-vserver/scripts/vserver.functions +++ b/util-vserver/scripts/vserver.functions @@ -376,7 +376,7 @@ function _generateChcontextOptions OPTS_VCONTEXT_CREATE=( $SILENT_OPT \ ${ctx:+--xid "$ctx"} ) ## put '--secure' at front so that it can be overridden - OPTS_VATTRIBUTE=( --secure "${OPTS_VATTRIBUTE[@]}" ) + OPTS_VATTRIBUTE=( --secure --flag default "${OPTS_VATTRIBUTE[@]}" ) } function _generateScheduleOptions @@ -812,10 +812,14 @@ function initWait $_VWAIT --timeout "$VSHELPER_SYNC_TIMEOUT" \ --status-fd 3 "$2" \ >>$_is_tmpdir/out 2>$_is_tmpdir/err 3>$_is_tmpdir/fifo + rc=$? - $_VPS axf | $_EGREP -e "^[^ \t]+[ \t]+$S_CONTEXT[ \t]+" >&4 + if test "$rc" -ne 0 -a "$rc" -ne 1; then + $_VPS axf | $_EGREP -e "^[^ \t]+[ \t]+$S_CONTEXT[ \t]+" >&4 + killContext "$S_CONTEXT" 9 + fi - killContext "$S_CONTEXT" 9 + exit $rc ) 4>$_is_tmpdir/procs & echo "$!" >$_is_tmpdir/pid @@ -827,10 +831,11 @@ function initWait ## Usage: _waitForVWait function _waitForVWait { + wait "$3" || : + declare -a status - declare -r procs=$4 + declare -r procs=$(cat $4) - wait "$3" || : getFileArray status "$2" set -- ${status[0]} @@ -851,8 +856,9 @@ A timeout occured while waiting for the vserver to finish and it will be killed by sending a SIGKILL signal. The following process list might be useful for finding out the reason of this behavior: -$procs -" +---------------------------------------------------------------------- +${procs:+$procs +}----------------------------------------------------------------------" ;; (\?\?\?|*) warning $"\ @@ -873,7 +879,7 @@ function waitForSync local vwait_pid=$4 if test -d "$vwait_statdir"; then - _waitForVWait "$cfgdir" "$vwait_statdir/fifo" "$( <$vwait_statdir/pid )" "$( < $vwait_statdir/procs )" + _waitForVWait "$cfgdir" "$vwait_statdir/fifo" "$( <$vwait_statdir/pid )" "$vwait_statdir/procs" elif test -n "$_NEED_VSHELPER_SYNC"; then $_VSHELPER_SYNC "$fifo" "$VSHELPER_SYNC_TIMEOUT" || \ warning $"\