X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Ffunctions;h=51318e7d3cda4d10cf2ede43671a1d23bc779031;hb=07a3904f8220fbc4d12d85fb45bc44eeefc3d6ae;hp=0a21393f16a847699e76d091f6edbfc38d958efe;hpb=be9c6aed872e34b625817e77e24c8897e5f7085c;p=util-vserver.git diff --git a/scripts/functions b/scripts/functions index 0a21393..51318e7 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1014,6 +1014,30 @@ function vshelper.getSyncTimeout eval $2=\$_vgst_tmp } +function vshelper.initStopSync +{ + local _iss_sync_dir=$($_MKTEMPDIR vshelper-stop-sync.XXXXXX) || { + warning $"Failed to generate directory for vshelper sync" + exit 1 + } + $_MKFIFO -m700 "$_iss_sync_dir/pipe" + + eval "$1"=\$_iss_sync_dir + VSHELPER_STOP_SYNC="$_iss_sync_dir/pipe" + export VSHELPER_STOP_SYNC +} + +function vshelper.waitForStopSync +{ + local sync_dir=$1 + cat "$sync_dir/pipe" &> /dev/null + rm -fr "$sync_dir" +} + +function vshelper.doStopSync +{ + test ! -p "$VSHELPER_STOP_SYNC" || echo stopped > "$VSHELPER_STOP_SYNC" +} function _rpmFake.getCapFlags {