4896N/A# The contents of this file are subject to the terms of the
4896N/A# Common Development and Distribution License (the "License").
4896N/A# You may not use this file except in compliance with the License.
6983N/A# See the License for the specific language governing permissions
4896N/A# and limitations under the License.
4896N/A# When distributing Covered Code, include this CDDL HEADER in each
6983N/A# If applicable, add the following below this CDDL HEADER, with the
6983N/A# fields enclosed by brackets "[]" replaced with your own identifying
6983N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4896N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4896N/A# Use is subject to license terms.
5410N/A#pragma ident "%Z%%M% %I% %E% SMI"
4896N/A# migrate the existing configuration values regardless of whether
4896N/ABASEPREFIX=`echo $BASEDIR | tr '/' '_'`
4896N/AFILENAME=`echo sunwrcapr"$BASEPREFIX" | cut -c 1-256`
4896N/A echo "$SVCADM enable $RCAP_FMRI" >> $PROFILE_UPGRADE
4896N/A pressure=`awk '$1 == "RCAPD_MEMORY_CAP_ENFORCEMENT_PRESSURE" \
4896N/A && NF == 3 {print $3}' $RCAP_CONF`
4896N/A reconfig_int=`awk '$1 == "RCAPD_RECONFIGURATION_INTERVAL" \
4896N/A && NF == 3 {print $3}' $RCAP_CONF`
4896N/A walk_int=`awk '$1 == "RCAPD_PROC_WALK_INTERVAL" && \
4896N/A NF == 3 {print $3}' $RCAP_CONF`
5410N/A report_int=`awk '$1 == "RCAPD_REPORT_INTERVAL" && \
5410N/A NF == 3 {print $3}' $RCAP_CONF`
4896N/A rss_sample_int=`awk '$1 == "RCAPD_RSS_SAMPLE_INTERVAL" && \
4896N/A NF == 3 {print $3}' $RCAP_CONF`
4896N/A # Update default configuration values with
4896N/A echo "# Migrating pre-existing rcap configuration" >> $PROFILE_UPGRADE
4896N/A if [ -n "$pressure" ]; then
4896N/A echo "$SVCCFG -s $RCAP_FMRI setprop ${PG}/pressure = " \
4896N/A "$pressure" >> $PROFILE_UPGRADE
4896N/A if [ -n "$reconfig_int" ]; then
4896N/A echo "$SVCCFG -s $RCAP_FMRI setprop ${PG}/reconfig_interval = " \
4896N/A "$reconfig_int" >> $PROFILE_UPGRADE
4896N/A if [ -n "$walk_int" ]; then
4896N/A echo "$SVCCFG -s $RCAP_FMRI setprop ${PG}/walk_interval = " \
4896N/A "$walk_int" >> $PROFILE_UPGRADE
4896N/A if [ -n "$report_int" ]; then
5410N/A echo "$SVCCFG -s $RCAP_FMRI setprop ${PG}/report_interval = " \
5410N/A "$report_int" >> $PROFILE_UPGRADE
4896N/A if [ -n "$rss_sample_int" ]; then
4896N/A echo "$SVCCFG -s $RCAP_FMRI setprop ${PG}/rss_sample_interval = " \
4896N/A "$rss_sample_int" >> $PROFILE_UPGRADE
4896N/A echo "$SVCADM refresh $RCAP_FMRI" >> $PROFILE_UPGRADE