r.manifest revision 7117
10139N/A#!/bin/sh
10139N/A#
10139N/A# CDDL HEADER START
10139N/A#
10139N/A# The contents of this file are subject to the terms of the
10139N/A# Common Development and Distribution License, Version 1.0 only
10139N/A# (the "License"). You may not use this file except in compliance
10139N/A# with the License.
10139N/A#
10139N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10139N/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
10139N/A# information: Portions Copyright [yyyy] [name of copyright owner]
10139N/A#
10139N/A# CDDL HEADER END
10139N/A#
10139N/A#
10139N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
10139N/A# Use is subject to license terms.
10139N/A#
10139N/A#ident "@(#)r.manifest 1.4 05/06/08 SMI"
10139N/A#
10139N/A# r.manifest - smf(5) manifest remove class action script
10139N/A#
10139N/A
10139N/Aif [ "$PKG_INSTALL_ROOT" != "" -a "$PKG_INSTALL_ROOT" != "/" ]; then
10139N/A #
10139N/A # We can't safely disable the service in this case.
10139N/A #
10139N/A smf_alive=no
10139N/Aelse
10139N/A #
10139N/A # We can verify if the service is disabled prior to
10139N/A # removal.
10139N/A #
10139N/A if [ -r /etc/svc/volatile/repository_door ]; then
10139N/A smf_alive=yes
10139N/A fi
10139N/Afi
10139N/A
10139N/AMFSTSCAN=/lib/svc/bin/mfstscan
10139N/ASVCCFG=/usr/sbin/svccfg
10139N/ASVCPROP=/usr/bin/svcprop
10139N/A
10139N/Awhile read mfst; do
10139N/A if [ "$smf_alive" = "yes" ]; then
10139N/A ENTITIES=`$SVCCFG inventory $mfst`
10139N/A
10139N/A for fmri in $ENTITIES; do
10139N/A #
10139N/A # Determine whether any of our instances are
10139N/A # enabled.
10139N/A #
10139N/A en_p=`$SVCPROP -C -p general/enabled $fmri 2>/dev/null`
10139N/A en_o=`$SVCPROP -C -p general_ovr/enabled $fmri 2>/dev/null`
10139N/A
10139N/A if [ "$en_p" = "true" -o "$en_o" = "true" ]; then
10139N/A echo "$fmri remains enabled; aborting"
10139N/A exit 1
10139N/A fi
10139N/A
10139N/A $SVCCFG delete $fmri
10139N/A done
10139N/A
10139N/A #
11965N/A # Delete the manifest hash value.
11965N/A #
10139N/A pg_name=`$MFSTSCAN -t $mfst`
10139N/A if $SVCPROP -q -p $pg_name smf/manifest; then
10139N/A $SVCCFG -s smf/manifest delpg $pg_name
10139N/A fi
11933N/A fi
10139N/A
10139N/A /usr/bin/rm $mfst
10139N/Adone
10139N/A
10139N/Aexit 0
10139N/A