From ff80fad3ccd946a0112a8ebf7a53c6f40f7fc187 Mon Sep 17 00:00:00 2001 From: Tomas Plesnik <plesnik@ics.muni.cz> Date: Thu, 1 Mar 2012 14:06:04 +0100 Subject: [PATCH] zmena exit statusu pro testu spustitelnosti; zmena nazvu funkci --- src/warden-server/bin/wardend | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/warden-server/bin/wardend b/src/warden-server/bin/wardend index 237c4e7..890d0e1 100755 --- a/src/warden-server/bin/wardend +++ b/src/warden-server/bin/wardend @@ -50,7 +50,7 @@ LOCK_FILE="/var/lock/warden-server" SCRIPTNAME=`basename "$0"` # check if daemon is present and executable -test -x $DAEMON || exit 1 +test -x $DAEMON || exit 0 if [ $UID -ne 0 ]; then echo "You must be root for runnnig this script!" @@ -63,7 +63,8 @@ usage() { } check_status() { - if /bin/ps axo pid,comm | grep -q "warden-server*"; then + /bin/ps axo pid,comm | grep -q "warden-server*"; RET_VAL=`echo $?` + if [ $RET_VAL -eq 0 ]; then STATUS=1 # true - warden is running else STATUS=0 # false - warden is not running @@ -75,7 +76,7 @@ get_pid() { return $PID } -start() { +warden_start() { check_status if [ $STATUS -eq 1 ]; then get_pid PID @@ -89,7 +90,7 @@ start() { fi } -stop() { +warden_stop() { check_status if [ $STATUS -eq 1 ]; then logger -s "Stopping Warden server daemon ..." @@ -106,7 +107,7 @@ stop() { fi } -status() { +warden_status() { check_status if [ $STATUS -eq 1 ]; then get_pid PID @@ -118,7 +119,7 @@ status() { fi } -force_stop() { +warden_force_stop() { check_status if [ $STATUS -eq 1 ]; then logger -s "Force stopping Warden server daemon ..." @@ -135,16 +136,16 @@ force_stop() { case $1 in status) - status + warden_status ;; start) - start + warden_start ;; stop) - stop + warden_stop ;; force-stop) - force_stop + warden_force_stop ;; restart) $0 stop -- GitLab