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