5886N/A#!/sbin/sh
5886N/A#
5886N/A# CDDL HEADER START
5886N/A#
5886N/A# The contents of this file are subject to the terms of the
5886N/A# Common Development and Distribution License (the "License").
5886N/A# You may not use this file except in compliance with the License.
5886N/A#
5886N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5886N/A# or http://www.opensolaris.org/os/licensing.
5886N/A# See the License for the specific language governing permissions
5886N/A# and limitations under the License.
5886N/A#
5886N/A# When distributing Covered Code, include this CDDL HEADER in each
5886N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5886N/A# If applicable, add the following below this CDDL HEADER, with the
5886N/A# fields enclosed by brackets "[]" replaced with your own identifying
5886N/A# information: Portions Copyright [yyyy] [name of copyright owner]
5886N/A#
5886N/A# CDDL HEADER END
5886N/A#
5886N/A# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
5886N/A
5886N/AFMRI=svc:/system/dbus:default
5886N/A
5886N/A. /lib/svc/share/smf_include.sh
5886N/A
5886N/Aif [ ! -x /usr/lib/dbus-daemon ]; then
5886N/A echo "/usr/lib/dbus-daemon not found or not executable"
5886N/A exit $SMF_EXIT_ERR_FATAL
5886N/Afi
5886N/A
5886N/A# Generate machine-id regardless of zones
5886N/Aif [ ! -f /var/lib/dbus/machine-id ]; then
5886N/A /usr/bin/dbus-uuidgen --ensure
5886N/Afi
5886N/A
5886N/Acase "$1" in
5886N/A'start')
5886N/A # temporary hacks
5886N/A if [ ! -d /var/run/dbus ]; then
5886N/A mkdir /var/run/dbus
5886N/A fi
5886N/A if [ -f /var/run/dbus/pid ]; then
5886N/A rm -f /var/run/dbus/pid
5886N/A fi
5886N/A
5886N/A (ulimit -S -n 8192 ; /usr/lib/dbus-daemon --system)
5886N/A err=$?
5886N/A if [ $err -ne 0 ]; then
5886N/A echo "dbus failed to start: error $err"
5886N/A exit $SMF_EXIT_ERR_FATAL
5886N/A fi
5886N/A
5886N/A ;;
5886N/A*)
5886N/A echo "Usage: $0 { start }"
5886N/A exit $SMF_EXIT_ERR_FATAL
5886N/A ;;
5886N/Aesac
5886N/A
5886N/Aexit $SMF_EXIT_OK