D-BUS init.d script for debian

Marco Canini marco.canini@fastwebnet.it
Fri, 09 Jan 2004 23:43:09 +0100


--=-nWX9r8yO1W9ol+DYhXkt
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This is the init.d script i'm using to start D-BUS in my debian box,
it's complete except for status action but i don't have the time to
implement the status action.
Anyway I hope this helps.

A comment on how it works:
i dropped the service name thing, and the pid file is generated by
start-stop-daemon, but i think it's overwritten by dbus-daemon-1 sine
the system wide config has a line to create the pid file

-- 
Marco Canini <marco.canini@fastwebnet.it>

--=-nWX9r8yO1W9ol+DYhXkt
Content-Disposition: attachment; filename=messagebus
Content-Type: text/x-sh; name=messagebus; charset=iso-8859-15
Content-Transfer-Encoding: 7bit

#!/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-1
# pidfile: /opt/gnome2/var/run/dbus/pid
#

# Sanity checks.
[ -x /opt/gnome2/bin/dbus-daemon-1 ] || exit 0

# so we can rearrange this easily
processname=/opt/gnome2/bin/dbus-daemon-1
pidfile=/opt/gnome2/var/run/dbus/pid

start() {
    echo -n "Starting system message bus: dbus"
    start-stop-daemon --start --quiet --pidfile $pidfile --exec $processname -- --system
    echo "."
}

stop() {
    echo -n $"Stopping system message bus: dbus"
    start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile
    echo "."
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    condrestart)
        if [ -f $pidfile ]; then
            stop
            start
        fi
        ;;
    reload)
        echo "Message bus can't reload its configuration, you have to restart it"
        exit 1
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|condrestart|reload}"
	exit 1
        ;;
esac
exit 0

--=-nWX9r8yO1W9ol+DYhXkt--