File use-killproc-in-stop-branch-of-SuSE-init-script.patch of Package firebird

From: Michal Kubecek <mkubecek@suse.cz>
Date: Tue, 12 Jun 2012 14:07:38 +0200
Subject: use killproc in stop branch of SuSE init script

In "stop" branch of SuSE init script, use killproc and fbguard
pidfile.
---
 .../arch-specific/linux/firebird.init.d.suse.in       | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/builds/install/arch-specific/linux/firebird.init.d.suse.in b/builds/install/arch-specific/linux/firebird.init.d.suse.in
index 5f3e33cd26b8..b5787ebdde09 100644
--- a/builds/install/arch-specific/linux/firebird.init.d.suse.in
+++ b/builds/install/arch-specific/linux/firebird.init.d.suse.in
@@ -43,6 +43,7 @@ test "$START_FIREBIRD" = yes || exit 0
 
 FIREBIRD=@FB_CONFDIR@
 FBRunUser=firebird
+FBRunGroup=firebird
 INSTANCE=default
 
 makeFbDir() {
@@ -55,14 +56,15 @@ makeFbDir() {
 			chmod $mode $mDir
 		fi
 	fi
-	chown $FBRunUser:$FBRunUser $mDir
+	chown $FBRunUser:$FBRunGroup $mDir
 }
-runDir=/var/run/firebird
-makeFbDir $runDir
+runDir=@FB_GUARDDIR@
+makeFbDir $runDir 0755
 lockDir=/tmp/firebird
 makeFbDir $lockDir 0770
 
 pidfile="$runDir/$INSTANCE.pid"
+gpidfile="$runDir/${INSTANCE}-guard.pid"
 
 export FIREBIRD
 
@@ -116,7 +118,8 @@ case "$1" in
 
 	# NOTE: startproc return 0, even if service is
 	# already running to match LSB spec.
-	startproc -u $FBRunUser $FBSBIN/fbguard -pidfile $pidfile -forever
+	startproc -u $FBRunUser $FBSBIN/fbguard -forever \
+		-pidfile "$pidfile" -gpidfile "$gpidfile"
 
 	# Remember status and be verbose
 	rc_status -v
@@ -126,13 +129,7 @@ case "$1" in
 	## Stop daemon with killproc(8) and if this fails
 	## set echo the echo return value.
 
-	## I had to use generic approach here - I can't test on suse. AP.
-	if [ -f $pidfile ]
-	then
-		kill `cat $pidfile`
-		sleep 1
-	fi
-		
+	killproc -p "$gpidfile" ${FBSBIN}/fbguard
 
 	# Remember status and be verbose
 	rc_status -v
-- 
2.8.1

openSUSE Build Service is sponsored by