packages: sssd/sssd.init - unify

glen glen at pld-linux.org
Fri Oct 21 09:32:36 CEST 2011


Author: glen                         Date: Fri Oct 21 07:32:35 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify

---- Files affected:
packages/sssd:
   sssd.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/sssd/sssd.init
diff -u packages/sssd/sssd.init:1.1 packages/sssd/sssd.init:1.2
--- packages/sssd/sssd.init:1.1	Mon Oct 17 03:19:44 2011
+++ packages/sssd/sssd.init	Fri Oct 21 09:32:30 2011
@@ -33,54 +33,57 @@
 
 start() {
 	# Check if the service is already running?
-	if [ ! -f /var/lock/subsys/sssd ]; then
-		msg_starting "System Security Services Daemon"
-		daemon --fork /usr/sbin/sssd --defaults-file=/etc/sssd/sssd.conf
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sssd
-	else
+	if [ -f /var/lock/subsys/sssd ]; then
 		msg_already_running "System Security Services Daemon"
+		return
 	fi
+
+	msg_starting "System Security Services Daemon"
+	daemon --fork /usr/sbin/sssd --defaults-file=/etc/sssd/sssd.conf
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sssd
 }
 
 stop() {
-	if [ -f /var/lock/subsys/sssd ]; then
-		# Stop daemons.
-		msg_stopping "System Security Services Daemon"
-		/sbin/start-stop-daemon -q --stop \
-			--retry TERM/600/KILL/10 \
-			-s TERM --pidfile /var/lib/sssd/sssd.pid
-		local result=$?
-		if [ "$result" -eq 0 ]; then
-			ok
-		else
-			fail
-		fi
+	if [ ! -f /var/lock/subsys/sssd ]; then
+		msg_not_running "System Security Services Daemon"
+		return
+	fi
 
-		rm -f /var/lock/subsys/sssd
+	# Stop daemons.
+	msg_stopping "System Security Services Daemon"
+	/sbin/start-stop-daemon -q --stop \
+		--retry TERM/600/KILL/10 \
+		-s TERM --pidfile /var/lib/sssd/sssd.pid
+	local result=$?
+	if [ "$result" -eq 0 ]; then
+		ok
 	else
-		msg_not_running "System Security Services Daemon"
+		fail
 	fi
+
+	rm -f /var/lock/subsys/sssd
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/sssd ]; then
-		stop
-		start
-	else
+	if [ ! -f /var/lock/subsys/sssd ]; then
 		msg_not_running "System Security Services Daemon"
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-  	start
+	start
 	;;
   stop)
-  	stop
+	stop
 	;;
   restart)
 	stop
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/sssd/sssd.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list