[Pkg-sks-commit] r61 - sks/trunk/sks/debian

chrism at alioth.debian.org chrism at alioth.debian.org
Thu Jun 19 14:45:53 UTC 2008


Author: chrism
Date: 2008-06-19 14:45:53 +0000 (Thu, 19 Jun 2008)
New Revision: 61

Modified:
   sks/trunk/sks/debian/init
Log:
[project @ 62]
Make it even nicer

Original author: weasel
Date: 2003-12-06 10:27:31.532397+00:00

Modified: sks/trunk/sks/debian/init
===================================================================
--- sks/trunk/sks/debian/init	2008-06-19 14:45:37 UTC (rev 60)
+++ sks/trunk/sks/debian/init	2008-06-19 14:45:53 UTC (rev 61)
@@ -22,15 +22,16 @@
 
 
 wait_for_deaddaemon () {
-	PID=$1
+	pidfile=$1
+	pid=`cat $pidfile 2>/dev/null` || true
 	sleep 1
-	if test -n "$PID"
+	if test -n "$pid"
 	then
-		if kill -0 $PID 2>/dev/null
+		if kill -0 $pid 2>/dev/null
 		then
 			echo -n "."
 			cnt=0
-			while kill -0 $PID 2>/dev/null
+			while kill -0 $pid 2>/dev/null
 			do
 				cnt=`expr $cnt + 1`
 				if [ $cnt -gt 30 ]
@@ -41,6 +42,9 @@
 				sleep 2
 				echo -n "."
 			done
+			rm -f $pidfile
+		else
+			rm -f $pidfile
 		fi
 	fi
 	return 0
@@ -80,17 +84,13 @@
     stop)
 	echo -n "Stopping sks daemons:"
 
-	pid=`cat $SKSRECONPID 2>/dev/null` || true
 	echo -n " sksrecon.."
 	start-stop-daemon --stop --quiet --oknodo --pidfile $SKSRECONPID
-	wait_for_deaddaemon $pid || exit 1
-	rm -f $SKSRECONPID
+	wait_for_deaddaemon $SKSRECONPID || exit 1
 
-	pid=`cat $SKSDBPID 2>/dev/null` || true
 	echo -n " sksdb.."
 	start-stop-daemon --stop --quiet --oknodo --pidfile $SKSDBPID
-	wait_for_deaddaemon $pid || exit 1
-	rm -f $SKSDBPID
+	wait_for_deaddaemon $SKSDBPID || exit 1
 
 	echo " done."
 




More information about the Pkg-sks-commit mailing list