From d70066a675db2be036d3989c4a5ebcdfbd9ca99e Mon Sep 17 00:00:00 2001
From: Tomas Plesnik <plesnik@ics.muni.cz>
Date: Thu, 1 Mar 2012 15:29:22 +0100
Subject: [PATCH] uprava funkce force-stop

---
 src/warden-server/bin/wardend | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/warden-server/bin/wardend b/src/warden-server/bin/wardend
index 890d0e1..5ee2387 100755
--- a/src/warden-server/bin/wardend
+++ b/src/warden-server/bin/wardend
@@ -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
 }
 
-- 
GitLab