svc-dbus revision 7945
10139N/A#!/sbin/sh
10139N/A#
10139N/A# CDDL HEADER START
10139N/A#
10139N/A# The contents of this file are subject to the terms of the
20788N/A# Common Development and Distribution License (the "License").
10139N/A# You may not use this file except in compliance with the License.
10139N/A#
10139N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
17185N/A# or http://www.opensolaris.org/os/licensing.
10139N/A# See the License for the specific language governing permissions
10139N/A# and limitations under the License.
10139N/A#
10139N/A# When distributing Covered Code, include this CDDL HEADER in each
10139N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
10139N/A# If applicable, add the following below this CDDL HEADER, with the
10139N/A# fields enclosed by brackets "[]" replaced with your own identifying
16880N/A# information: Portions Copyright [yyyy] [name of copyright owner]
10139N/A#
12274N/A# CDDL HEADER END
15389N/A#
16985N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
16985N/A# Use is subject to license terms.
16985N/A#
16985N/A# ident "@(#)svc-dbus 1.1 06/04/24 SMI"
16999N/A
19858N/AFMRI=svc:/system/dbus:default
19858N/A
19858N/A. /lib/svc/share/smf_include.sh
19858N/A
18540N/Aif [ ! -x /usr/bin/dbus-daemon ]; then
18540N/A echo "/usr/bin/dbus-daemon not found or not executable"
18688N/A exit $SMF_EXIT_ERR_FATAL
10139N/Afi
12679N/A
19099N/Aif smf_is_nonglobalzone; then
10139N/A echo "dbus-daemon cannot be run in non-global zones"
10139N/A exit $SMF_EXIT_ERR_FATAL
10139N/Afi
20857N/A
16880N/Acase "$1" in
16880N/A'start')
16880N/A # temporary hacks
16880N/A if [ ! -d /var/run/dbus ]; then
16880N/A mkdir /var/run/dbus
16880N/A fi
16880N/A if [ -f /var/run/dbus/pid ]; then
16880N/A rm -f /var/run/dbus/pid
16880N/A fi
16880N/A
20788N/A /usr/bin/dbus-daemon --system
17809N/A err=$?
20239N/A if [ $err -ne 0 ]; then
16880N/A echo "dbus failed to start: error $err"
17951N/A exit $SMF_EXIT_ERR_FATAL
20788N/A fi
17926N/A ;;
16880N/A*)
20239N/A echo "Usage: $0 { start }"
16880N/A exit $SMF_EXIT_ERR_FATAL
16880N/A ;;
16880N/Aesac
16880N/A
16880N/Aexit $SMF_EXIT_OK
16880N/A