7082N/A#!/bin/sh
7082N/A#
7117N/A# CDDL HEADER START
7117N/A#
7117N/A# The contents of this file are subject to the terms of the
7117N/A# Common Development and Distribution License, Version 1.0 only
7117N/A# (the "License"). You may not use this file except in compliance
7117N/A# with the License.
7117N/A#
7117N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7117N/A# or http://www.opensolaris.org/os/licensing.
7117N/A# See the License for the specific language governing permissions
7117N/A# and limitations under the License.
7117N/A#
7117N/A# When distributing Covered Code, include this CDDL HEADER in each
7117N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7117N/A# If applicable, add the following below this CDDL HEADER, with the
7117N/A# fields enclosed by brackets "[]" replaced with your own identifying
7117N/A# information: Portions Copyright [yyyy] [name of copyright owner]
7117N/A#
7117N/A# CDDL HEADER END
7117N/A#
7117N/A#
7117N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
7082N/A# Use is subject to license terms.
7082N/A#
7117N/A#ident "@(#)r.manifest 1.4 05/06/08 SMI"
7082N/A#
7082N/A# r.manifest - smf(5) manifest remove class action script
7082N/A#
7082N/A
7082N/Aif [ "$PKG_INSTALL_ROOT" != "" -a "$PKG_INSTALL_ROOT" != "/" ]; then
7082N/A #
7082N/A # We can't safely disable the service in this case.
7082N/A #
7082N/A smf_alive=no
7082N/Aelse
7082N/A #
7082N/A # We can verify if the service is disabled prior to
7082N/A # removal.
7082N/A #
7082N/A if [ -r /etc/svc/volatile/repository_door ]; then
7082N/A smf_alive=yes
7082N/A fi
7082N/Afi
7082N/A
7117N/AMFSTSCAN=/lib/svc/bin/mfstscan
7117N/ASVCCFG=/usr/sbin/svccfg
7082N/ASVCPROP=/usr/bin/svcprop
7082N/A
7082N/Awhile read mfst; do
7082N/A if [ "$smf_alive" = "yes" ]; then
7117N/A ENTITIES=`$SVCCFG inventory $mfst`
7082N/A
7082N/A for fmri in $ENTITIES; do
7082N/A #
7082N/A # Determine whether any of our instances are
7082N/A # enabled.
7082N/A #
7117N/A en_p=`$SVCPROP -C -p general/enabled $fmri 2>/dev/null`
7117N/A en_o=`$SVCPROP -C -p general_ovr/enabled $fmri 2>/dev/null`
7082N/A
7082N/A if [ "$en_p" = "true" -o "$en_o" = "true" ]; then
7082N/A echo "$fmri remains enabled; aborting"
7082N/A exit 1
7082N/A fi
7082N/A
7117N/A $SVCCFG delete $fmri
7082N/A done
7117N/A
7117N/A #
7117N/A # Delete the manifest hash value.
7117N/A #
7117N/A pg_name=`$MFSTSCAN -t $mfst`
7117N/A if $SVCPROP -q -p $pg_name smf/manifest; then
7117N/A $SVCCFG -s smf/manifest delpg $pg_name
7117N/A fi
7082N/A fi
7082N/A
7082N/A /usr/bin/rm $mfst
7082N/Adone
7082N/A
7082N/Aexit 0