Einstein47
Programmer
It is the oddest thing. We have a script to restart WAS every morning because of database changes. The script finds and kills the java processes, then waits a few seconds, then restarts WAS. Sometimes this works (most of the time), but occasionally it starts up all the java processes, but the "Ready for e-business" never shows up in the logs. We have to manually call the script and get WAS running again.
This is the restart script:
if [[ `ps -eo pid,ruser,command | grep java | grep -v bigbro | grep -v BEServer | awk ' { print $1 } ' | wc -l` -gt 0 ]];
then
print " ... Stopping WebSphere"
/usr/local/bin/psfind java
kill -15 `ps -eo pid,ruser,command | grep java | grep -v bigbro | grep -v BEServer | awk ' { print $1 } '`
print " ... WebSphere has been stopped.\n"
else
print " ... WebSphere is not running.\n"
fi
print " ... Restarting WebSphere"
sleep 12
./startupServer.sh & ;
[\b]
The greps are to keep this script from killing other processes that aren't related to WAS. The crazy thing is that this same script works 9 times out of 10 and then it fails without other configuration changes.
What am I doing wrong? What would be better?
Einstein47
(The greatest trick the devil ever did was to convice the world he didn't exists.)
This is the restart script:
if [[ `ps -eo pid,ruser,command | grep java | grep -v bigbro | grep -v BEServer | awk ' { print $1 } ' | wc -l` -gt 0 ]];
then
print " ... Stopping WebSphere"
/usr/local/bin/psfind java
kill -15 `ps -eo pid,ruser,command | grep java | grep -v bigbro | grep -v BEServer | awk ' { print $1 } '`
print " ... WebSphere has been stopped.\n"
else
print " ... WebSphere is not running.\n"
fi
print " ... Restarting WebSphere"
sleep 12
./startupServer.sh & ;
[\b]
The greps are to keep this script from killing other processes that aren't related to WAS. The crazy thing is that this same script works 9 times out of 10 and then it fails without other configuration changes.
What am I doing wrong? What would be better?
Einstein47
(The greatest trick the devil ever did was to convice the world he didn't exists.)