#!/sbin/sh # # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)svc-dbus 1.1 06/04/24 SMI" FMRI=svc:/system/dbus:default . /lib/svc/share/smf_include.sh if [ ! -x /usr/lib/dbus-daemon ]; then echo "/usr/lib/dbus-daemon not found or not executable" exit $SMF_EXIT_ERR_FATAL fi # Generate machine-id regardless of zones if [ ! -f /var/lib/dbus/machine-id ]; then /usr/bin/dbus-uuidgen --ensure fi case "$1" in 'start') # temporary hacks if [ ! -d /var/run/dbus ]; then mkdir /var/run/dbus fi if [ -f /var/run/dbus/pid ]; then rm -f /var/run/dbus/pid fi /usr/lib/dbus-daemon --system err=$? if [ $err -ne 0 ]; then echo "dbus failed to start: error $err" exit $SMF_EXIT_ERR_FATAL fi ;; *) echo "Usage: $0 { start }" exit $SMF_EXIT_ERR_FATAL ;; esac exit $SMF_EXIT_OK