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() {
}
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
STATUS=1 # true - warden is running
else
......@@ -72,7 +72,7 @@ check_status() {
}
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
}
......@@ -120,17 +120,14 @@ warden_status() {
}
warden_force_stop() {
check_status
if [ $STATUS -eq 1 ]; then
logger -s "Force stopping Warden server daemon ..."
get_pid PID
kill -9 $PID
if [ -e $PID_FILE ]; then
rm -f $PID_FILE
fi
logger -s "Force stopping Warden server daemon ..."
get_pid PID
kill -9 $PID 1>/dev/null 2>&1
if [ -e $PID_FILE ]; then
rm -f $PID_FILE
fi
if [ -e $LOCK_FILE ]; then
rm -f $LOCK_FILE
else
echo "Warden daemon is NOT running."
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