SOURCES: haldaemon.init - less indenting

glen glen at pld-linux.org
Wed Feb 25 22:35:19 CET 2009


Author: glen                         Date: Wed Feb 25 21:35:18 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- less indenting

---- Files affected:
SOURCES:
   haldaemon.init (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: SOURCES/haldaemon.init
diff -u SOURCES/haldaemon.init:1.13 SOURCES/haldaemon.init:1.14
--- SOURCES/haldaemon.init:1.13	Tue Oct  7 10:19:09 2008
+++ SOURCES/haldaemon.init	Wed Feb 25 22:35:13 2009
@@ -19,56 +19,61 @@
 
 start() {
 	# First step: check for running messagebus service
-	if [ -f /var/lock/subsys/messagebus ]; then
-		# Check if the service is already running?
-		if [ ! -f /var/lock/subsys/haldaemon ]; then
-		    msg_starting haldaemon
-		    # Syslog output
-			if is_yes "$USE_SYSLOG"; then
-				daemon /usr/sbin/hald --use-syslog
-			else
-				daemon /usr/sbin/hald
-			fi
-		    RETVAL=$?
-		    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haldaemon
-		else
-		    msg_already_running haldaemon
-		fi
-	else
+	if [ |! -f /var/lock/subsys/messagebus ]; then
 		msg_not_running messagebus
+		return
 	fi
-}
 
-stop() {
+	# Check if the service is already running?
 	if [ -f /var/lock/subsys/haldaemon ]; then
-		# Stop daemons.
-		msg_stopping haldaemon
-		killproc hald
-		rm -f /var/lock/subsys/haldaemon
+		msg_already_running haldaemon
+		return
+	fi
+
+	msg_starting haldaemon
+	# Syslog output
+	if is_yes "$USE_SYSLOG"; then
+		daemon /usr/sbin/hald --use-syslog
 	else
+		daemon /usr/sbin/hald
+	fi
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/haldaemon
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/haldaemon ]; then
 		msg_not_running haldaemon
+		return
 	fi
+
+	# Stop daemons.
+	msg_stopping haldaemon
+	killproc hald
+	rm -f /var/lock/subsys/haldaemon
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/haldaemon ]; then
-		stop
-		start
-	else
+	if [ ! -f /var/lock/subsys/haldaemon ]; then
 		msg_not_running haldaemon
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 reload() {
-	if [ -f /var/lock/subsys/haldaemon ]; then
-		msg_reloading haldaemon
-		killproc hald -HUP
-		RETVAL=$?
-	else
+	if [ ! -f /var/lock/subsys/haldaemon ]; then
 		msg_not_running haldaemon
 		RETVAL=7
+		return
 	fi
+
+	msg_reloading haldaemon
+	killproc hald -HUP
+	RETVAL=$?
 }
 
 # See how we were called.
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/haldaemon.init?r1=1.13&r2=1.14&f=u



More information about the pld-cvs-commit mailing list