#!/bin/bash # $Header: /root/magellan-cvs/src/dbus/dbus.rc-1.0,v 1.2 2008-12-25 17:12:21 niro Exp $ #%rlevels: 0:k 1:k 6:k 7:s #%start: 58 #%stop: 50 #deps #%needs: #%before: #%after: source /etc/conf.d/rc source $rc_functions case "$1" in start) echo -e ${COLOREDSTAR}"Starting D-BUS system messagebus ..." /usr/bin/dbus-uuidgen --ensure # run state must exists [[ ! -e /var/run/dbus ]] && mkdir /var/run/dbus start-stop-daemon \ --start \ --pidfile /var/run/dbus.pid \ --exec /usr/bin/dbus-daemon -- --system evaluate_retval splash svc_started splash 0 ;; stop) echo -e ${COLOREDSTAR}"Stopping D-BUS system messagebus ..." start-stop-daemon --stop --pidfile /var/run/dbus.pid evaluate_retval # remove pid file if exist [[ -f /var/run/dbus.pid ]] && rm /var/run/dbus.pid # remose system socket if exist [[ -S /var/run/dbus/system_bus_socket ]] && rm -f /var/run/dbus/system_bus_socket splash svc_stopped splash 0 ;; reload) echo -e ${COLOREDSTAR}"Reloading D-BUS configuration ..." /usr/bin/dbus-send \ --print-reply \ --system \ --type=method_call \ --dest=org.freedesktop.DBus \ / org.freedesktop.DBus.ReloadConfig > /dev/null evaluate_retval ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|reload|restart}" exit 1 ;; esac