--- dbus-0.34/bus/messagebus.in.orig 2005-01-19 01:20:38 +0300 +++ dbus-0.34/bus/messagebus.in 2005-07-12 16:44:46 +0400 @@ -2,7 +2,7 @@ # # messagebus: The D-BUS systemwide message bus # -# chkconfig: 345 97 03 +# chkconfig: 345 46 03 # description: This is a daemon which broadcasts notifications of system events \ # and other messages. See http://www.freedesktop.org/software/dbus/ # @@ -7,9 +7,13 @@ # and other messages. See http://www.freedesktop.org/software/dbus/ # # processname: dbus-daemon +# config: /etc/dbus-1 # pidfile: @DBUS_SYSTEM_PID_FILE@ # +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + # Sanity checks. [ -x @EXPANDED_BINDIR@/dbus-daemon ] || exit 0 @@ -20,29 +24,27 @@ processname=dbus-daemon servicename=messagebus +LOCKFILE=@EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename +PIDFILE=@DBUS_SYSTEM_PID_FILE@ +USER=messagebus + RETVAL=0 start() { - echo -n $"Starting system message bus: " - daemon --check $servicename $processname --system + msg_starting $"system messagebus" + start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --no-announce -- \ + "$processname" --system RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename + return $RETVAL } stop() { - echo -n $"Stopping system message bus: " - - ## we don't want to kill all the per-user $processname, we want - ## to use the pid file *only*; because we use the fake nonexistent - ## program name "$servicename" that should be safe-ish - killproc $servicename -TERM + msg_stopping $"system messagebus" + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --no-announce \ + "$processname" -TERM + rm -f "$PIDFILE" ||: RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename - rm -f @DBUS_SYSTEM_PID_FILE@ - fi + return $RETVAL } # See how we were called. @@ -54,25 +56,30 @@ stop ;; status) - status $processname - RETVAL=$? + status --pidfile "$PIDFILE" --expect-user "$USER" $processname + RETVAL=$? ;; restart) stop start ;; + condstop) + if [ -f "$LOCKFILE" ]; then + stop + fi + ;; condrestart) - if [ -f @EXPANDED_LOCALSTATEDIR@/lock/subsys/$servicename ]; then + if [ -f "$LOCKFILE" ]; then stop start fi - ;; + ;; reload) - echo "Message bus can't reload its configuration, you have to restart it" - RETVAL=$? + msg_usage "Message bus can't reload its configuration, you have to restart it" + RETVAL=1 ;; *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + echo $"Usage: $0 {start|stop|status|restart|condstop|condrestart|reload}" ;; esac exit $RETVAL