X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvserver-wrapper;h=abab44549d70f75328b27db35a5e6b6a252f7e01;hb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;hp=ccbd2e134813f488b19b2f924ea2956170b8bcab;hpb=3f3cf95f755f3ef1c31ad8e38153deb4ee214c66;p=util-vserver.git diff --git a/scripts/vserver-wrapper b/scripts/vserver-wrapper index ccbd2e1..abab445 100755 --- a/scripts/vserver-wrapper +++ b/scripts/vserver-wrapper @@ -26,35 +26,13 @@ test -n "$MARK" || MARK=default : ${LOCKFILE:=vservers-$MARK} : ${NUMPARALLEL:=6} - -if test -e /etc/init.d/functions; then - . /etc/init.d/functions - lockfile=/var/lock/subsys/$LOCKFILE -else - success() { echo .; } - passed() { echo .; } - failure() { echo ERROR; } - lockfile=/var/run/$LOCKFILE -fi - - -function _tellResult() -{ - local rc=$1 - case "$rc" in - (0) success;; - (2) passed; rc=0;; - (*) failure;; - esac - echo - return $rc -} +. "$_LIB_VSERVER_INIT_FUNCTIONS" function start() { - echo -n $"Starting vservers of type '$MARK'..." + _beginResult $"Starting vservers of type '$MARK'" $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --start - _tellResult $? + _endResult $? local rc=$? test "$rc" -ne 0 || touch "$lockfile" return $rc @@ -62,9 +40,9 @@ function start() function stop() { - echo -n $"Stopping vservers of type '$MARK'..." + _beginResult $"Stopping vservers of type '$MARK'" $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --stop - _tellResult $? + _endResult $? local rc=$? $_RM -f "$lockfile" return $rc