rc.messagebus, new proposal

Nikolai Geogriev voyager123bg at gmail.com
Sun Jan 14 04:27:42 PST 2007


Hello out there, I've rewritten rc.messagebus in order to make it more readable.

Here's my version:

#!/bin/sh
#
# messagebus:   The D-BUS systemwide message bus
#
# chkconfig: 345 97 03
# description:  This is a daemon which broadcasts notifications of
system events \
#               and other messages. See
http://www.freedesktop.org/software/dbus/
#
# processname: dbus-daemon
# pidfile: /var/run/dbus/pid
#
# modified by Voyager

# Sanity checks.

[ -x /usr/bin/dbus-daemon ] || exit 0

#See how we were called
case "$1" in
    start)
        echo "Starting system message bus..."
        /usr/bin/dbus-daemon --system
        echo -n "done"
        ;;
    stop)
        echo "Stopping system message bus..."
        killall -9 dbus-daemon
        rm -f /var/run/dbus/*
        echo -n "done"
        ;;
    status)
        IS_DBUS=`ps -A|grep dbus-daemon|awk {'print $4'}`
        if [ "$IS_DBUS" = "dbus-daemon" ]; then
            echo "Dbus is running!"
        else
            echo "Dbus is not running!"
        fi
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart}"
        ;;
esac


Hope this helps,
Voyager


More information about the dbus mailing list