packages: cups/cups.init - unify

glen glen at pld-linux.org
Wed Dec 14 23:13:54 CET 2011


Author: glen                         Date: Wed Dec 14 22:13:54 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify

---- Files affected:
packages/cups:
   cups.init (1.24 -> 1.25) 

---- Diffs:

================================================================
Index: packages/cups/cups.init
diff -u packages/cups/cups.init:1.24 packages/cups/cups.init:1.25
--- packages/cups/cups.init:1.24	Fri May  1 01:24:41 2009
+++ packages/cups/cups.init	Wed Dec 14 23:13:49 2011
@@ -29,49 +29,56 @@
 
 start() {
 	# Check if the service is already running?
-	if [ ! -f /var/lock/subsys/cups ]; then
-		msg_starting CUPS
-		daemon /usr/sbin/cupsd -c /etc/cups/cupsd.conf
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups
-	else
+	if [ -f /var/lock/subsys/cups ]; then
 		msg_already_running CUPS
+		return
 	fi
+
+	msg_starting CUPS
+	daemon /usr/sbin/cupsd -c /etc/cups/cupsd.conf
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups
 }
 
 stop() {
 	# Stop daemons.
-	if [ -f /var/lock/subsys/cups ]; then
-		msg_stopping CUPS
-		killproc cupsd
-		rm -f /var/lock/subsys/cups >/dev/null 2>&1
-	else
+	if [ ! -f /var/lock/subsys/cups ]; then
 		msg_not_running CUPS
+		return
 	fi
+
+	msg_stopping CUPS
+	killproc cupsd
+	rm -f /var/lock/subsys/cups >/dev/null 2>&1
+}
+
+reload() {
+	if [ ! -f /var/lock/subsys/cups ]; then
+		msg_not_running CUPS
+		RETVAL=7
+		return
+	fi
+
+	msg_reloading CUPS
+	killproc cupsd -HUP
+	RETVAL=$?
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-  	start
+	start
 	;;
   stop)
-  	stop
+	stop
 	;;
   restart)
 	stop
 	start
 	;;
   reload|force-reload)
-	if [ -f /var/lock/subsys/cups ]; then
-		msg_reloading CUPS
-		killproc cupsd -HUP
-		RETVAL=$?
-	else
-		msg_not_running CUPS
-		exit 7
-	fi
+	reload
 	;;
   status)
 	status cups cupsd
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cups/cups.init?r1=1.24&r2=1.25&f=u



More information about the pld-cvs-commit mailing list