From ce7839f43ee5c73d52ba32051a8ca11c5865ed12 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Sun, 1 Oct 2006 21:58:51 +0000 Subject: [PATCH] This commit was manufactured by cvs2git to create branch 'AC-branch'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Cherrypick from master 2006-10-01 21:58:51 UTC Elan Ruusamäe '- use functions, fix force-reload': messagebus.init -> 1.8 --- messagebus.init | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 messagebus.init diff --git a/messagebus.init b/messagebus.init new file mode 100644 index 0000000..0c9d4f0 --- /dev/null +++ b/messagebus.init @@ -0,0 +1,85 @@ +#!/bin/sh +# +# messagebus The D-BUS systemwide message bus +# +# chkconfig: 345 22 85 +# +# description: This is a daemon which broadcasts notifications of system +# events and other messages. +# +# pidfile: /var/run/dbus.pid + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network ]; then + msg_network_down messagebus + exit 1 + fi +else + exit 0 +fi + +start() { + # Check if the service is already running? + if [ ! -f /var/lock/subsys/messagebus ]; then + msg_starting messagebus + daemon dbus-daemon --system + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus + else + msg_already_running messagebus + fi +} + +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 + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + 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 + ;; + status) + status messagebus dbus-daemon + RETVAL=$? + ;; + *) + msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + exit 3 +esac + +exit $RETVAL + +# This must be last line ! -- 2.44.0