packages: dbus/messagebus.init - unify with template.init, short --pidfile ...

glen glen at pld-linux.org
Mon Mar 22 23:49:39 CET 2010


Author: glen                         Date: Mon Mar 22 22:49:39 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify with template.init, short --pidfile for consistency

---- Files affected:
packages/dbus:
   messagebus.init (1.17 -> 1.18) 

---- Diffs:

================================================================
Index: packages/dbus/messagebus.init
diff -u packages/dbus/messagebus.init:1.17 packages/dbus/messagebus.init:1.18
--- packages/dbus/messagebus.init:1.17	Mon Mar 22 23:44:56 2010
+++ packages/dbus/messagebus.init	Mon Mar 22 23:49:34 2010
@@ -18,7 +18,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
 	if [ ! -f /var/lock/subsys/network ]; then
-		msg_network_down messagebus
+		msg_network_down "D-BUS Message bus"
 		exit 1
 	fi
 else
@@ -27,41 +27,55 @@
 
 start() {
 	# Check if the service is already running?
-	if [ ! -f /var/lock/subsys/messagebus ]; then
-		msg_starting messagebus
-		# if capability is modular, load it
-		if modinfo capability >/dev/null 2>&1; then
-			modprobe -s capability
-		fi
-		dbus-uuidgen --ensure
-		daemon --pidfile dbus.pid /usr/bin/dbus-daemon --system
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
-	else
-		msg_already_running messagebus
+	if [ -f /var/lock/subsys/messagebus ]; then
+		msg_already_running "D-BUS Message bus"
+		return
+	fi
+
+	msg_starting "D-BUS Message bus"
+	# if capability is modular, load it
+	if modinfo capability >/dev/null 2>&1; then
+		modprobe -s capability
 	fi
+	dbus-uuidgen --ensure
+	daemon --pidfile dbus.pid /usr/bin/dbus-daemon --system
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
 }
 
 stop() {
-	if [ -f /var/lock/subsys/messagebus ]; then
-		# Stop daemons.
-		msg_stopping messagebus
-		killproc --pidfile dbus.pid dbus-daemon
-		rm -f /var/lock/subsys/messagebus
-		rm -f /var/run/dbus.pid
-	else
-		msg_not_running messagebus
+	if [ ! -f /var/lock/subsys/messagebus ]; then
+		msg_not_running "D-BUS Message bus"
+		return
 	fi
+
+	# Stop daemons.
+	msg_stopping "D-BUS Message bus"
+	killproc --pidfile dbus.pid dbus-daemon
+	rm -f /var/lock/subsys/messagebus /var/run/dbus.pid
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/messagebus ]; then
-		stop
-		start
-	else
-		msg_not_running messagebus
+	if [ ! -f /var/lock/subsys/messagebus ]; then
+		msg_not_running "D-BUS Message bus"
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
+}
+
+reload() {
+	if [ ! -f /var/lock/subsys/messagebus ]; then
+		msg_not_running "D-BUS Message bus"
+		RETVAL=7
+		return
+	fi
+
+	msg_reloading "D-BUS Message bus"
+	killproc --pidfile dbus.pid dbus-daemon -HUP
+	RETVAL=$?
 }
 
 RETVAL=0
@@ -81,17 +95,10 @@
 	condrestart 0
 	;;
   reload|force-reload)
-	if [ -f /var/lock/subsys/messagebus ]; then
-		msg_reloading messagebus
-		killproc dbus-daemon -HUP
-		RETVAL=$?
-	else
-		msg_not_running messagebus
-		RETVAL=7
-	fi
+  	reload
 	;;
   status)
-	status --pidfile /var/run/dbus.pid messagebus dbus-daemon
+	status --pidfile dbus.pid messagebus dbus-daemon
 	RETVAL=$?
 	;;
   *)
================================================================

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



More information about the pld-cvs-commit mailing list