#! /bin/sh # -*- coding: iso8859-1 -*- # Debian init.d script for D-BUS # Copyright (c) 2003 Colin Walters set -e DAEMON=/usr/bin/dbus-daemon-1 NAME=dbus-1 DAEMONUSER=messagebus PIDFILE=/var/run/dbus/pid DESC="system message bus" test -x $DAEMON || exit 0 # Source defaults file; edit that file to configure this script. ENABLED=1 PARAMS="" if [ -e /etc/default/dbus-1 ]; then . /etc/default/dbus-1 fi test "$ENABLED" != "0" || exit 0 case "$1" in start) echo -n "Starting $DESC: " if [ ! -d /var/run/dbus ]; then mkdir /var/run/dbus chown $DAEMONUSER:$DAEMONUSER /var/run/dbus fi start-stop-daemon -S \ -u $DAEMONUSER -x $DAEMON -- --system $PARAMS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon -K \ -u $DAEMONUSER -x $DAEMON -- --system $PARAMS echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon -K \ -u $DAEMONUSER -x $DAEMON -- --system $PARAMS sleep 1 start-stop-daemon -S \ -u $DAEMONUSER -x $DAEMON -- --system $PARAMS echo "$NAME." ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0