Skip to content
Snippets Groups Projects
Commit d70066a6 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

uprava funkce force-stop

parent 69d64148
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ usage() { ...@@ -63,7 +63,7 @@ usage() {
} }
check_status() { check_status() {
/bin/ps axo pid,comm | grep -q "warden-server*"; RET_VAL=`echo $?` /bin/ps axo pid,comm | grep -q "warden-serv*"; RET_VAL=`echo $?`
if [ $RET_VAL -eq 0 ]; then if [ $RET_VAL -eq 0 ]; then
STATUS=1 # true - warden is running STATUS=1 # true - warden is running
else else
...@@ -72,7 +72,7 @@ check_status() { ...@@ -72,7 +72,7 @@ check_status() {
} }
get_pid() { get_pid() {
PID=`ps axo pid,comm | grep "warden-server*" | sed 's/^ \{1,4\}//g' | cut -f 1 -d " "` PID=`ps axo pid,comm | grep "warden-serv*" | sed 's/^ \{1,4\}//g' | cut -f 1 -d " "`
return $PID return $PID
} }
...@@ -120,17 +120,14 @@ warden_status() { ...@@ -120,17 +120,14 @@ warden_status() {
} }
warden_force_stop() { warden_force_stop() {
check_status logger -s "Force stopping Warden server daemon ..."
if [ $STATUS -eq 1 ]; then get_pid PID
logger -s "Force stopping Warden server daemon ..." kill -9 $PID 1>/dev/null 2>&1
get_pid PID if [ -e $PID_FILE ]; then
kill -9 $PID rm -f $PID_FILE
if [ -e $PID_FILE ]; then fi
rm -f $PID_FILE if [ -e $LOCK_FILE ]; then
fi
rm -f $LOCK_FILE rm -f $LOCK_FILE
else
echo "Warden daemon is NOT running."
fi fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment