postinstall revision 7c478bd95313f5f23a4c958a745db2134aa03244
0N/A#
1472N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License, Version 1.0 only
0N/A# (the "License"). You may not use this file except in compliance
0N/A# with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1472N/A#
1472N/A# CDDL HEADER END
1472N/A#
0N/A#
0N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
0N/A#
0N/A# ident "%Z%%M% %I% %E% SMI"
0N/A#
0N/A
0N/A#
0N/A# Clear sysidtool which may have gone into maintenance due to a dependency
0N/A# cycle with milestone/single-user, when upgrading to a system that
0N/A# introduces milestone/sysconfig.
0N/A#
0N/Acat >> $BASEDIR/var/svc/profile/upgrade <<\_CLRSYSID
0N/A /usr/sbin/svcadm clear svc:/system/sysidtool:net
0N/A /usr/sbin/svcadm clear svc:/system/sysidtool:system
0N/A_CLRSYSID
0N/A
0N/Aif [ -h $BASEDIR/var/mail.ABCsavedXYZ ] ; then
0N/A rmdir $BASEDIR/var/mail/:saved >/dev/null 2>&1
0N/A if [ $? = 0 ] ; then
0N/A rmdir $BASEDIR/var/mail >/dev/null 2>&1
0N/A if [ $? = 0 ] ; then
0N/A mv $BASEDIR/var/mail.ABCsavedXYZ $BASEDIR/var/mail
0N/A fi
0N/A fi
0N/A rm -fr $BASEDIR/var/mail.ABCsavedXYZ
0N/Afi
0N/A
0N/Aif [ -h $BASEDIR/var/news.ABCsavedXYZ ] ; then
0N/A rmdir $BASEDIR/var/news >/dev/null 2>&1
0N/A if [ $? = 0 ] ; then
0N/A mv $BASEDIR/var/news.ABCsavedXYZ $BASEDIR/var/news
0N/A fi
0N/A rm -fr $BASEDIR/var/news.ABCsavedXYZ
0N/Afi
0N/A
0N/APMTAB=$BASEDIR/etc/saf/tcp/_pmtab
0N/Aif [ -f $PMTAB ] ; then
0N/A sed -e 's/\\x00020ACE......../\\x00020ACE00000000/' \
0N/A -e 's/\\x00020203......../\\x0002020300000000/' $PMTAB >/tmp/t.$$
0N/A cp /tmp/t.$$ $PMTAB
780N/Afi
780N/A
0N/AAUTH_ATTR=$BASEDIR/etc/security/auth_attr
0N/Aif [ -f $AUTH_ATTR ] ; then
0N/A sed '/^solaris\.\*/d' $AUTH_ATTR > /tmp/a.$$
0N/A cp /tmp/a.$$ $AUTH_ATTR
0N/A rm -f /tmp/a.$$
0N/Afi
0N/A
0N/AINITTAB=$BASEDIR/etc/inittab
0N/Aif [ -f $INITTAB -a -n "$SUNW_PKG_INSTALL_ZONENAME" -a \
0N/A "$SUNW_PKG_INSTALL_ZONENAME" != "global" ]; then
0N/A sed -e '/^ap:/d' -e '/^sp:/d' $INITTAB > /tmp/i.$$
0N/A cp /tmp/i.$$ $INITTAB
0N/A rm -f /tmp/i.$$
0N/Afi
0N/A
0N/AVFSTAB=$BASEDIR/etc/vfstab
0N/Aif [ -f $VFSTAB -a -n "$SUNW_PKG_INSTALL_ZONENAME" -a \
0N/A "$SUNW_PKG_INSTALL_ZONENAME" != "global" ]; then
0N/A sed '/^\/devices[ ]/d' $VFSTAB > /tmp/v.$$
0N/A cp /tmp/v.$$ $VFSTAB
0N/A rm -f /tmp/v.$$
0N/Afi
0N/A
0N/A#
0N/A# Get rid of obsolete BIND 8 server instance
0N/A#
0N/Acat >> $BASEDIR/var/svc/profile/upgrade <<\_DEL_BIND8
0N/A obs_se=/usr/sbin/in.named
0N/A cur_se=`svcprop -p start/exec svc:/network/dns/server 2>/dev/null`
0N/A if [ "$obs_se" = "$cur_se" ]; then
0N/A svcadm disable -s svc:/network/dns/server:default
0N/A svccfg delete svc:/network/dns/server:default
0N/A # If this was the only instance, delete the service also
0N/A svcs network/dns/server >/dev/null 2>&1 || \
0N/A svccfg delete svc:/network/dns/server
0N/A fi
0N/A_DEL_BIND8
0N/A
0N/A#
0N/A# svc:/network/rpc/keyserv is expected to be off on systems that don't
0N/A# set domainname. On systems that do define a default domain, leave the
0N/A# setting as previously set.
0N/A#
0N/Acat >> $BASEDIR/var/svc/profile/upgrade <<\_CSVC_UPGRADE_2
0N/A if [ ! -f /etc/defaultdomain ]; then
0N/A svcadm disable network/rpc/keyserv
0N/A fi
0N/A_CSVC_UPGRADE_2
0N/A
0N/Aif [ "$UPDATE" != yes ]; then
0N/A #
0N/A # On initial install, default to ns_files.xml. The installer will
0N/A # customize, if appropriate.
0N/A #
0N/A ln -s ns_files.xml $BASEDIR/var/svc/profile/name_service.xml
0N/Aelif [ ! -r $BASEDIR/var/svc/profile/name_service.xml ]; then
0N/A #
0N/A # Associate name service profile, if none present.
0N/A #
0N/A grep ldap $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
0N/A is_ldap=$?
0N/A grep nisplus $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
0N/A is_nisplus=$?
0N/A grep nis $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
0N/A is_nis=$?
0N/A
0N/A if [ $is_ldap = 0 ]; then
0N/A ns_profile=ns_ldap.xml
0N/A elif [ $is_nisplus = 0 ]; then
0N/A ns_profile=ns_nisplus.xml
0N/A elif [ $is_nis = 0 ]; then
0N/A ns_profile=ns_nis.xml
0N/A else
0N/A ns_profile=ns_files.xml
0N/A fi
0N/A
0N/A ln -s $ns_profile $BASEDIR/var/svc/profile/name_service.xml
0N/A
0N/A grep dns $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
0N/A if [ $? = 0 ]; then
0N/A echo "/usr/sbin/svcadm enable network/dns/client" >> \
0N/A $BASEDIR/var/svc/profile/upgrade
0N/A fi
0N/Afi
27N/A
0N/A#
0N/A# Associate correct inetd services profile.
0N/A#
0N/Arm -f $BASEDIR/var/svc/profile/inetd_services.xml
0N/Aif [ "$UPDATE" = yes ]; then
0N/A ln -s inetd_upgrade.xml $BASEDIR/var/svc/profile/inetd_services.xml
0N/A # Ensure inetd-upgrade is run post-upgrade
0N/A echo "/usr/sbin/svcadm enable network/inetd-upgrade" >> \
0N/A $BASEDIR/var/svc/profile/upgrade
0N/Aelse
0N/A ln -s inetd_generic.xml $BASEDIR/var/svc/profile/inetd_services.xml
0N/Afi
0N/A
0N/A#
0N/A# /etc/svc/repository.db was previously packaged but it is now generated
0N/A# from one of the seed repositories and then updated by svccfg(1M).
0N/A# Therefore, removef(1M) is used to remove the packaging database entry
0N/A# although the repository itself is preserved.
0N/A#
0N/A/usr/sbin/removef $PKGINST /etc/svc/repository.db >/dev/null 2>&1
0N/A/usr/sbin/removef -f $PKGINST >/dev/null 2>&1
0N/A
0N/A# Solaris audit's internal "enable/disable" state is maintained by
0N/A# c2audit; if c2audit accepts the auditconfig query, then auditing
0N/A# is enabled and SMF should enable auditd.
0N/A#
0N/Acat >> $BASEDIR/var/svc/profile/upgrade <<\_ENABLE_AUDIT
0N/A/usr/sbin/auditconfig -getcond 2> /dev/null
0N/Aif [ $? -eq 0 ]; then
0N/A /usr/sbin/svcadm enable system/auditd
0N/Afi
0N/A_ENABLE_AUDIT
0N/A
0N/Aexit 0
0N/A