diff --git a/src/warden-server/bin/wardend b/src/warden-server/bin/wardend index 237c4e729ecf06941d36767c17c3b4a0dd3a5c28..890d0e117c7eb26a0d44600bd163c5ba0f631b69 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