postinstall revision 0ea5e3a571e3da934507bdd32924d11659c70704
0N/A#
2362N/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 (the "License").
0N/A# You may not use this file except in compliance with the License.
2362N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2362N/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]
0N/A#
0N/A# CDDL HEADER END
0N/A#
2362N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2362N/A# Use is subject to license terms.
2362N/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.
2080N/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
2465N/A fi
2465N/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
0N/Afi
0N/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
obs_se=/usr/sbin/in.named
cur_se=`svcprop -p start/exec svc:/network/dns/server 2>/dev/null`
if [ "$obs_se" = "$cur_se" ]; then
svcadm disable -s svc:/network/dns/server:default
svccfg delete svc:/network/dns/server:default
# If this was the only instance, delete the service also
svcs network/dns/server >/dev/null 2>&1 || \
svccfg delete svc:/network/dns/server
fi
_DEL_BIND8
#
# Remove stale GLD services
#
SVCCFG_REPOSITORY=$PKG_INSTALL_ROOT/etc/svc/repository.db
export SVCCFG_REPOSITORY
if [ -x /usr/sbin/svcadm -a -x /usr/sbin/svccfg -a \
-f $PKG_INSTALL_ROOT/var/svc/manifest/network/datalink.xml ]; then
if [ -r $PKG_INSTALL_ROOT/etc/svc/volatile/repository_door ]; then
#
# Local package install. Need to disable the services first
# before deleting.
#
svcadm disable -s svc:/network/aggregation >/dev/null 2>&1
svcadm disable -s svc:/network/datalink-init >/dev/null 2>&1
svcadm disable -s svc:/network/datalink >/dev/null 2>&1
fi
svccfg delete svc:/network/aggregation >/dev/null 2>&1
svccfg delete svc:/network/datalink-init >/dev/null 2>&1
svccfg delete svc:/network/datalink >/dev/null 2>&1
fi
#
# svc:/network/rpc/keyserv is expected to be off on systems that don't
# set domainname. On systems that do define a default domain, leave the
# setting as previously set.
#
cat >> $BASEDIR/var/svc/profile/upgrade <<\_CSVC_UPGRADE_2
if [ ! -f /etc/defaultdomain ]; then
svcadm disable network/rpc/keyserv
fi
_CSVC_UPGRADE_2
if [ "$UPDATE" != yes ]; then
#
# On initial install, default to ns_files.xml. The installer will
# customize, if appropriate.
#
ln -s ns_files.xml $BASEDIR/var/svc/profile/name_service.xml
elif [ ! -r $BASEDIR/var/svc/profile/name_service.xml ]; then
#
# Associate name service profile, if none present.
#
grep ldap $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
is_ldap=$?
grep nisplus $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
is_nisplus=$?
grep nis $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
is_nis=$?
if [ $is_ldap = 0 ]; then
ns_profile=ns_ldap.xml
elif [ $is_nisplus = 0 ]; then
ns_profile=ns_nisplus.xml
elif [ $is_nis = 0 ]; then
ns_profile=ns_nis.xml
else
ns_profile=ns_files.xml
fi
ln -s $ns_profile $BASEDIR/var/svc/profile/name_service.xml
grep dns $BASEDIR/etc/nsswitch.conf >/dev/null 2>&1
if [ $? = 0 ]; then
echo "/usr/sbin/svcadm enable network/dns/client" >> \
$BASEDIR/var/svc/profile/upgrade
fi
fi
#
# Associate correct inetd services profile.
#
rm -f $BASEDIR/var/svc/profile/inetd_services.xml
if [ "$UPDATE" = yes ]; then
ln -s inetd_upgrade.xml $BASEDIR/var/svc/profile/inetd_services.xml
# Ensure inetd-upgrade is run post-upgrade
echo "/usr/sbin/svcadm enable network/inetd-upgrade" >> \
$BASEDIR/var/svc/profile/upgrade
else
ln -s inetd_generic.xml $BASEDIR/var/svc/profile/inetd_services.xml
fi
#
# /etc/svc/repository.db was previously packaged but it is now generated
# from one of the seed repositories and then updated by svccfg(1M).
# Therefore, removef(1M) is used to remove the packaging database entry
# although the repository itself is preserved.
#
/usr/sbin/removef $PKGINST /etc/svc/repository.db >/dev/null 2>&1
/usr/sbin/removef -f $PKGINST >/dev/null 2>&1
# Solaris audit's internal "enable/disable" state is maintained by
# c2audit; if c2audit accepts the auditconfig query, then auditing
# is enabled and SMF should enable auditd.
#
cat >> $BASEDIR/var/svc/profile/upgrade <<\_ENABLE_AUDIT
/usr/sbin/auditconfig -getcond 2> /dev/null
if [ $? -eq 0 ]; then
/usr/sbin/svcadm enable system/auditd
fi
_ENABLE_AUDIT
if [ -f $BASEDIR/var/SUNWcsr-apply-limited-net ]; then
PROFILEDIR=$BASEDIR/var/svc/profile
UPGRADEFILE=${PROFILEDIR}/upgrade
ln -sf ./generic_limited_net.xml ${PROFILEDIR}/generic.xml
cat >> ${UPGRADEFILE} <<\_ENABLE_LIMITED_NET
#
# apply the generic_limit_net profile selected at install
# time, and set the accompanying properties since they can't
# be readily set in the profile as of yet.
#
apply_limited_net()
{
/usr/sbin/netservices limited
}
# apply_limited_net as last action of this upgrade script
trap apply_limited_net 0
_ENABLE_LIMITED_NET
rm -f $BASEDIR/var/SUNWcsr-apply-limited-net
fi
exit 0