packages: heimdal/heimdal.init - foolproof way of checking if kdc started

baggins baggins at pld-linux.org
Wed Jul 8 01:41:29 CEST 2009


Author: baggins                      Date: Tue Jul  7 23:41:29 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- foolproof way of checking if kdc started

---- Files affected:
packages/heimdal:
   heimdal.init (1.16 -> 1.17) 

---- Diffs:

================================================================
Index: packages/heimdal/heimdal.init
diff -u packages/heimdal/heimdal.init:1.16 packages/heimdal/heimdal.init:1.17
--- packages/heimdal/heimdal.init:1.16	Wed Jul  8 01:11:07 2009
+++ packages/heimdal/heimdal.init	Wed Jul  8 01:41:24 2009
@@ -30,18 +30,20 @@
 fi
 
 start() {
+	local pid
+
 	if [ ! -f /var/lock/subsys/heimdal ]; then
 		msg_starting "Kerberos KDC"
 		busy
-		kdc &
+		daemon kdc --detach
 		sleep 1
-		if ps -C kdc >/dev/null 2>&1; then
+		pid=$(pidofproc "kdc" "/var/run/kdc.pid")
+		if [ -n "$pid" ]; then
+			touch /var/lock/subsys/heimdal
 			ok
 		else
 			fail
 		fi
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/heimdal
 	else
 		msg_already_running "Kerberos KDC"
 	fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/heimdal/heimdal.init?r1=1.16&r2=1.17&f=u



More information about the pld-cvs-commit mailing list