#!/bin/bash
#
# Startup script for dbus
#
# chkconfig: 345 10 18
# 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
# sigreload: HUP

ARGS="--fork --system"

start () {
  get_data
  echo -n "Starting $SHORT: "
  if [ -x /usr/bin/dbus-uuidgen ] ; then
    /usr/bin/dbus-uuidgen --ensure
  fi

  # Create /var/run/dbus since /var/run is tmpfs
  install -m 755 -d /var/run/dbus
  chown messagebus:messagebus /var/run/dbus

  dbus-daemon $ARGS &> /dev/null
  if [ $? == 0 ] ; then
    mkpid
    echo -e $RESULT_OK
  else
    echo -e $RESULT_FAIL
  fi
}

. /lib/lsb/init-functions $1
