The following bit of insanity was crafted by myself and my partner in crime
Dave Hansen.
Here's what we have for an environment:
Two production nodes in a cluster, Two QA nodes in a cluster, and two single
node test systems, all running on the same z/VM.
We have a z/VM guest called 'LNXADMIN' on which we created a 192 disk, and
stuck and accessed it as disk 'n'
for each of our linuxes there are two files. an IPL file and a DELAY file:
ABINODJI DELAY N1 F 80 1 1 11/17/06 9:52
ABINODJI IPL N1 V 7 1 1 9/26/07 2:45
The delay file contains an offset in seconds to wait before starting WebSphere.
This only comes into play on a Sunday, since that's the only day of
the month we do scheduled maintenance, and we don't want 6 WebSpheres all
starting at the same time.
* * * Top of File * * *
DELAY=780
* * * End of File * * *
The other file is the 'IPL' file. Which was going to contain anything we wanted
to tell the guest not to do when it was IPL'ed. SO far, we just have a
yes/no for WebSphere in the file:
* * * Top of File * * *
WAS=YES
* * * End of File * * *
We control the entries with a couple of scripts
The script we use takes the parms Y or N and {server name} and sets the server
in question to YES or NO. If no server is passed, it sets ALL of them
to yes or no. Very simple. You can also edit the files manually in a pinch.
The Linux guests uses the CMSFS to access the LNXADMIN 192 disk which has been
CP linked in profile exec at IPL time as 292. There are other options
than CMSFS now, and arguably better, but this isn't broke, so I'm not fixing it.
The was6_start.sh script, which I've included below, reads the IPL file, and if
it's a Sunday, it reads the delay file. IF the IPL parm is set to
WAS=NO then WebSphere will not be started. If the 292 disk is not present,
WebSphere will be started. If the parm is WAS=YES, WebSphere will be
started. We can manually start WebSphere with the script websphere_start which
does stuff like:
echo -e "\nStarting Deployment Manager"
/opt/wasprofile/DeploymentManager/bin/startManager.sh -replacelog
echo -e "\nStarting Node Agent"
/opt/wasprofile/AppServer/bin/startNode.sh -replacelog -nowait
echo -e "\nStarting Application server 'server1'"
/opt/wasprofile/AppServer/bin/startServer.sh server1 -replacelog &
_________________________________
The was6_start.sh script
#! /bin/sh
export COLUMNS=
#fold hostname into IPL file name convert to upper case and assign.
hostfile=`echo $HOSTNAME.ipl | tr '[:lower:]' '[:upper:]'`
delayfile=`echo $HOSTNAME.delay | tr '[:lower:]' '[:upper:]'`
echo Hostfile = $hostfile
echo Delayfile = $delayfile
# bring device 292 online to linux
if chccwdev -e 0.0.0292 2>&1 > /dev/null
then
echo "292 found"
# Cat the contents of /proc/dasd/devices to extract the dasd device
dasd292=`cat /proc/dasd/devices | grep 292 | awk '{print $7}'`
#check to see if the ipl file exists
if cmsfscat -a -d /dev/$dasd292 $hostfile > /dev/null 2>&1 > /dev/null
then
# cat the ipl file on the 292 disk and extract the value for starting
was
startwas=`cmsfscat -a -d /dev/$dasd292 $hostfile | grep WAS | awk -F
= '{print $2}'` 2>&1 >/dev/null
else
echo "no $hostfile file found - WebSphere will be started"
startwas='YES'
fi
#check to see if the delay file exists
if cmsfscat -a -d /dev/$dasd292 $delayfile > /dev/null 2>&1 > /dev/null
then
# cat the delay file on the 292 disk and extract the delay value for
starting was
raw_delay=`cmsfscat -a -d /dev/$dasd292 $delayfile | grep DELAY | awk
-F = '{print $2}'` 2>&1 >/$
delaywas=`echo $raw_delay | tr '[:blank:]' ' '`
else
echo "no $delay file found - WebSphere startup will not be delayed"
delaywas='0'
fi
# bring device 292 offline to linux
chccwdev -d 0.0.0292 > /dev/null
else
# 292 not found - default to YES to start WebSphere
echo "Device 0.0.0292 - LNXADMIN CMS volume not defined to system -
Websphere will be started"
startwas='YES'
fi
echo startwas = $startwas
if [ $startwas == 'YES' ]
then
if [ `date +%A` == 'Sunday' ]
then
echo "It's a Sunday. Probably an IPL happening eh?"
echo "Starting WebSphere in $delaywas seconds"
sleep `echo $delaywas`
fi
echo "Starting Websphere"
sh /etc/init.d/websphere_start &
else
echo "WebSphere automatic startup overridden at IPL"
echo "WebSphere WILL NOT BE STARTED. Start manually when ready."
fi
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390