X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fdbus%2FS30dbus;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fdbus%2FS30dbus;h=0d15c730432e9815e94b316f4e4669ac6e19613a;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/dbus/S30dbus b/cirros-testvm/src-cirros/buildroot-2015.05/package/dbus/S30dbus new file mode 100755 index 0000000..0d15c73 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/dbus/S30dbus @@ -0,0 +1,78 @@ +#!/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/messagebus.pid +# + +# Sanity checks. +[ -x /usr/bin/dbus-daemon ] || exit 0 + +# Create needed directories. +[ -d /var/run/dbus ] || mkdir -p /var/run/dbus +[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys +[ -d /tmp/dbus ] || mkdir -p /tmp/dbus + +RETVAL=0 + +start() { + echo -n "Starting system message bus: " + + dbus-uuidgen --ensure + dbus-daemon --system + RETVAL=$? + echo "done" + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon +} + +stop() { + echo -n "Stopping system message bus: " + + ## we don't want to kill all the per-user $processname, we want + ## to use the pid file *only*; because we use the fake nonexistent + ## program name "$servicename" that should be safe-ish + killall dbus-daemon + RETVAL=$? + echo "done" + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/dbus-daemon + rm -f /var/run/messagebus.pid + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + reload) + echo "Message bus can't reload its configuration, you have to restart it" + RETVAL=$? + ;; + *) + echo "Usage: $0 {start|stop|status|restart|condrestart|reload}" + ;; +esac +exit $RETVAL