Results 1 to 3 of 3
Hello,
Here's what I'm trying to do... any help that I can get is greatly appreciated.
I have a Red Hat 5 server the hosts a Hyperion installation. I'm trying ...
- 03-13-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 7
bash scripting help needed...
Hello,
Here's what I'm trying to do... any help that I can get is greatly appreciated.
I have a Red Hat 5 server the hosts a Hyperion installation. I'm trying to automate the process of stopping and starting all of the Hyperion services. I have completed the shutdown process and have no problems with that. The startup process is however giving me a real hard time.
Basicaly I have 13 individual scripts that need to be started in a particular order. To keep this simple I refer to them as script1.sh, script2.sh script3.sh... you get the picture.
- All scripts need to be started by User1.
- All scripts must be run as a background process, so that when User1 logs out the process continues to run.
- Script1.sh is started. Script2.sh can not start until script1.sh has finished... Which is where I'm having trouble...
I have tired the following:
I created a master start script called Start_all.sh. In this script I source my environment and then call each script in order as follows:
. /home/user1/script1.sh &
wait
. /home/user1/script2.sh &
wait
. /home/user1/script3.sh &
and so on....
The issue that I'm having with this is the wait does just that... it never moves to script2.sh.
I know that there is a way that you can string commands together but the keep here is I don't want the second script to start until the first script has done its job by starting the processes needed.
Any help that can be provided will be greatly appreciated. If you need more info please let me know.
- 03-15-2009 #2Linux Newbie
- Join Date
- Feb 2009
- Location
- Third ring of Pergatory
- Posts
- 199
what shell our you calling for your script
I've seen the ampersands on a couple of internet sources either before or after the "wait" command, not sure what shell those are for, I don't use them in bash.
- 03-16-2009 #3Just Joined!
- Join Date
- Mar 2009
- Posts
- 7
I have resolved this issue on my own. Here's what I came up with in the event that others out there are looking to do the same thing. I'm sure there are better ways to do this... but I spent most of the weekend testing this script and it is working very well compared to what we had in place before:
#!/bin/bash
### Script to Start All Hyperion Services
### This WILL take a while
### Script Created 03/13/2009
### Created By L. Lindeman, UGI Utilities, Inc.
### Last Modified Date: 03/16/2009
### Last Modified By: L. Lindeman
## Set Hyperion Environment
HYPERION_HOME="/app/oracle/hyperion"; export HYPERION_HOME
HYPERION_HOME_ID="1"; export HYPERION_HOME_ID
## Create a seperator in the Hyperion_StartUp.log
echo "************************************************* ************************************************** " >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "************************************************* ************************************************** " >> Hyperion_StartUp.log
## Time Stamping the Start of the Server Start-up process
date >> Hyperion_StartUp.log
## Start the Node Manager Process
echo running startHyperionNodeManager.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionNodeManager.sh &" >> Hyperion_StartUp.log
## Check that Node Manager Process is up before moving to next service.
while [ zZz != 0 ]
do
if netstat -an |grep 5556 > /dev/null
then
zZz=0
echo "NodeManager Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionWebLogic.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionWebLogic.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 7001 > /dev/null
then
zZz=0
echo "Hyperion WebLogic Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionSharedServices9.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionSharedServices9.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 28080 > /dev/null
then
zZz=0
echo "Shared Services9 Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionCoreServices.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionCoreServices.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 6800 > /dev/null
then
zZz=0
echo "Core Services Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionApache.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionApache.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if ps ax | grep -v grep | grep httpServers > /dev/null
then
zZz=0
echo "Hyperion Apache Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionWorkspace.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionWorkspace.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 45000 > /dev/null
then
zZz=0
echo "Hyperion Workspace Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionFinancialServices.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionFinancialServices.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if ps ax | grep -v grep | grep report > /dev/null
then
zZz=0
echo "Hyperion Financial Services Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionFinancialReporting.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionFinancialReporting.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 8200 > /dev/null
then
zZz=0
echo "Hyperion Financial Reporting Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionWebAnalysis.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionWebAnalysis.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 16000 > /dev/null
then
zZz=0
echo "Hyperion Web Analysis Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionRMIRegistry.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionRMIRegistry.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 16000 > /dev/null
then
zZz=0
echo "Hyperion RMI Registry Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionEAS.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionEAS.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 10080 > /dev/null
then
zZz=0
echo "Hyperion EAS Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionAPS.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionAPS.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 13080 > /dev/null
then
zZz=0
echo "Hyperion APS Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo running startHyperionPlanning.sh >> Hyperion_StartUp.log
date >> Hyperion_StartUp.log
su - oraas13 -c "/home/oraas13/scripts/startHyperionPlanning.sh &" >> Hyperion_StartUp.log
while [ zZz != 0 ]
do
if netstat -an |grep 8300 > /dev/null
then
zZz=0
echo "Hyperion Planning Started..." >> Hyperion_StartUp.log
break
else
zZz=1
echo -ne "." >> Hyperion_StartUp.log
fi
done
date >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " >> Hyperion_StartUp.log
echo "================================================= ================================================== " >> Hyperion_StartUp.log


Reply With Quote