452 Implementing a Tivoli Solution for Central Management of Large Distributed Environments
# ***********************************************************
# ** Support for Silent Migration
# **
# ** NOTE:
# ** 1. You must uncomment and modify EVERY property
# ** in this section for silent migration to work properly.
# ** 2. You can not perform migration and coexistence at
# ** the same time.
# **
# ***********************************************************
# ***********************************************************
# The installer must be informed that you wish to operate on
# a previous version, so you must tell it that one is present
# by uncommenting the next line.
# ***********************************************************
# -W previousVersionDetectedBean.previousVersionDetected=”true”
# ***********************************************************
# Direct the installer to operate on a specific previous version by
# uncommenting the next line and entering one of these values:
#
# Value Edition
# ***** *******
# AE WAS Advanced Edition (V3.x, V4.0.x)
# advanced AE
# AEs WAS Advanced Single Server Edition (V4.0.x)
# standard WAS Standard Edition (V3.x)
#
# Note:
# For migration from WAS V5.0.x, this field is not used. So simply
# set previousVersionPanelBean.selectedVersionEdition to “<NONE>”.
# ************************************************************
# -W previousVersionPanelBean.selectedVersionEdition=”AEs”
# ************************************************************
# Specify the location where the previous version is installed.
# ************************************************************
# -W
previousVersionPanelBean.selectedVersionInstallLocation=”/opt/IBM/WebSphere/App
Server”
# ************************************************************
# Specify the path to the configuration file for the
# previous version. Configuration filenames are:
#
Appendix A. Configuration files and scripts 453
# Value previousVersionPanelBean.selectedVersionEdition
# ***** ***********************************************
# admin.config AE
# admin.config advanced
# server-cfg AEs
# server-cfg standard
#
# Note:
# For migration from WAS V5.0.x, this field is not used. So simply
# set previousVersionPanelBean.selectedVersionConfigFile to “<NONE>”.
# ************************************************************
# -W
previousVersionPanelBean.selectedVersionConfigFile=”/opt/IBM/WebSphere/AppServe
r/config/server-cfg.xml”
# ************************************************************
# Specify the version number of the previous version:
5.0.2,5.0.1,5.0.0,4.0,4.0.1,3.5, etc...
# ************************************************************
# -W previousVersionPanelBean.previousVersionSelected=”4.0”
# ************************************************************
# Uncomment the below line to indicate that you wish to
# migrate the previous version.
# ************************************************************
# -W previousVersionPanelBean.migrationSelected=”true”
# ************************************************************
# Specify the directory where migration will backup
# information about the previous version.
# ************************************************************
# -W migrationInformationPanelBean.migrationBackupDir=”/tmp/migrationbackup”
# ************************************************************
# Specify the directory where migration logs will be stored.
# ************************************************************
# -W migrationInformationPanelBean.migrationLogfileDir=”/tmp/migrationlogs”
was_appserver_510_install.sh
Example A-44 on page 454 is the installation script for WebSphere Application
Server 5.1.
454 Implementing a Tivoli Solution for Central Management of Large Distributed Environments
Example: A-44 Script for installation of WAS 5.1
#!/bin/sh
## this is a basic script to create users nd groups required for
## succesful installation of WebSphere APplication Server v5.1 on Linux
##
##
## To make this script ready for production, review paths, user and group
names
## and add logging....
doit () {
echo “Executing command: “ $1
$1
rc=$?
echo “-- result was: “ $rc
return $rc;
}
build_group_list ()
{
action=$1
grp_list=$2
case $action in
add)
new_group_list=$grp
;;
remove)
new_group_list=””
;;
esac
##
##
##echo $grp_list | tr “ “ “\n” | while read GROUP;
##do
for GROUP in $grp_list;
do
##echo “read group $GROUP”
case $action in
add)
if [ x$GROUP = x$grp ]; then
# return, already there
echo “Returning - user $usr already member of group $grp”
new_group_list=””
return 4
Appendix A. Configuration files and scripts 455
fi
new_group_list=$new_group_list,$GROUP
;;
remove)
if [ x$GROUP != x$grp ]; then
if [ x$new_groups = x ]; then
new_group_list=$GROUP
else
new_group_list=$new_group_list,$GROUP
fi
##else
##echo “ommiting group ‘$grp’ target to be removed”
fi
esac
##echo “Working group list is:” $new_group_list
done
##echo “New group list:” $new_group_list
return 0
}
user_mod () {
##
##
##
##echo “Received: “$@
usrfile=/etc/passwd
grpfile=/etc/group
action=$1
usr=$2
grp=$3
##echo “inspecting groups for ${action}’ing ‘$usr’ to/from ‘$grp’”
## get current secondary groups
a=‘grep $usr:x: $usrfile | awk -F: ‘{ print $1 }’‘
if [ x$a = x ]; then
echo “User ‘$usr’ does not exist”
return 4
fi
a=‘grep $grp:x: $grpfile | awk -F: ‘{ print $1 }’‘
if [ x$a = x ]; then
echo “Group ‘$grp’ does not exist”
return 4
fi
456 Implementing a Tivoli Solution for Central Management of Large Distributed Environments
a=‘grep :$usr $grpfile | awk -F: ‘{ print $1 }’‘
b=‘grep ,$usr $grpfile | awk -F: ‘{ print $1 }’‘
old_group_list=‘echo $a $b | tr “\n” “ “‘
##echo “current group list:” $old_group_list
tst=‘echo $old_groups | tr “ “ “\n” | grep $grp‘
case $action in
add)
# return if currently a member
if [ x$tst = x$grp ]; then
echo “‘$usr’ is already a member of ‘$grp’”
return 0
fi
;;
remove)
# return if currently not a member
if [ x$tst = x ]; then
echo “‘$usr’ is NOT a member of ‘$grp’”
return 0
fi
;;
esac
build_group_list “$action” “$old_group_list
rc=$?
if [ $rc = 0 ]; then
cmd=”usermod -G $new_group_list $usr”
## echo “About to execute: “$cmd
doit “$cmd”
rc=$?
fi
return $rc
}
usr_mod_group () {
func=$1
grp=$2
usr=$3
grpfile=/etc/group
cp $grpfile $grpfile-backup
sedfile=sed.tmp
tmpfile=tmp.tmp
newfile=new.tmp
old=‘grep $grp:x: $grpfile‘
# is group already defined
if [ $old == ““ ]; then

Get Implementing a Tivoli Solution for Central Management of Large Distributed Environments now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.