diff options
author | Martin Lefebvre <dadexter@gmail.com> | 2010-05-11 14:56:12 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 14:56:12 +0200 |
commit | d7d571be321b81c83f49aea5c880e97d5bf53944 (patch) | |
tree | a45375de032857154f51b1d659d8d27ed36b7104 /libraries/dbus/rc.messagebus.new | |
parent | 44cd355e08de676c5379d2db342d17001b674442 (diff) |
libraries/dbus: Initial import
Diffstat (limited to 'libraries/dbus/rc.messagebus.new')
-rw-r--r-- | libraries/dbus/rc.messagebus.new | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/libraries/dbus/rc.messagebus.new b/libraries/dbus/rc.messagebus.new new file mode 100644 index 0000000000..ab3df69511 --- /dev/null +++ b/libraries/dbus/rc.messagebus.new @@ -0,0 +1,71 @@ +#!/bin/sh +# +# messagebus: The D-BUS systemwide message bus +# +# 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 + +# This is a modified version of the rc.messagebus script distributed with the +# dbus sources. Thanks to Don Tanner of the GWare <http://gware.org> Project +# for most of the work involved --Robby Workman <http://rlworkman.net> + + +PIDFILE=/var/run/dbus/dbus.pid + +start() { + echo -n "Starting system message bus: " + if [ -x /usr/bin/dbus-uuidgen ] ; then + echo -n "/usr/bin/dbus-uuidgen --ensure" + /usr/bin/dbus-uuidgen --ensure + fi + + if [ -x /usr/bin/dbus-daemon ];then + echo -n " ; /usr/bin/dbus-daemon --system" + /usr/bin/dbus-daemon --system 1>/dev/null 2>/dev/null + fi + echo +} + +stop() { + echo "Stopping system message bus..." + if [ -e "$PIDFILE" ]; then + pid=$(cat $PIDFILE) + kill $pid 1>/dev/null 2>/dev/null + rm -f $PIDFILE + else + killall dbus-daemon 1>/dev/null 2>/dev/null + fi +} + +reload() { + echo "Reloading system message bus configuration..." + if [ -e "$PIDFILE" ]; then + pid=$(cat $PIDFILE) + kill -HUP $pid + else + killall -HUP dbus-daemon + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + reload + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload}" + ;; +esac |