svc-syseventd revision 6927f468b0af7710df000f6b16f6ee413e1e3007
2N/A#!/sbin/sh
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A#
2N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2N/A# Use is subject to license terms.
2N/A#
2N/A#ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A. /lib/svc/share/smf_include.sh
2N/A
2N/Acase "$1" in
2N/A'start')
2N/A if /usr/lib/sysevent/syseventd >/dev/msglog 2>&1; then :; else
2N/A exit
2N/A fi
2N/A
2N/A # Establish the default framebuffer name.
2N/A
2N/A fbdev=`/usr/sbin/prtconf -F 2>/dev/null`
2N/A
2N/A if [ $? -eq 0 ]; then
2N/A set -- /devices$fbdev*
2N/A if [ -c $1 ]; then
2N/A rm -f /dev/fb
2N/A ln -s $1 /dev/fb
2N/A fi
2N/A fi
2N/A ;;
2N/A
2N/A#
2N/A# devfsadmd and syseventconfd are started on-demand
2N/A# by syseventd. syseventd should be stopped before devfsadm and syseventconfd.
2N/A#
2N/A'stop')
2N/A dpid=`/usr/bin/pgrep devfsadm`
2N/A scpid=`/usr/bin/pgrep syseventconfd`
2N/A spid=`/usr/bin/pgrep syseventd`
2N/A zone=`smf_zonename`
2N/A /usr/bin/pkill -x -u 0 -P 1 -z $zone rcm_daemon
2N/A /usr/bin/pkill -x -u 0 -P 1 -z $zone syseventd
2N/A /usr/bin/pkill -x -u 0 -P 1 -z $zone devfsadm
2N/A /usr/bin/pkill -x -u 0 -P 1 -z $zone syseventconfd
2N/A
2N/A #
2N/A # Since pkill is not atomic (may miss forking processes), also
2N/A # kill entire service contract.
2N/A #
2N/A smf_kill_contract $2 TERM 1
2N/A [ $? -ne 0 ] && exit 1
2N/A ;;
2N/A
2N/A*)
2N/A echo "Usage: $0 { start | stop }"
2N/A exit 1
2N/A ;;
2N/A
2N/Aesac
2N/Aexit 0
2N/A