Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script will not run at startup (RedHat Linux)

Status
Not open for further replies.

siswjh

MIS
Dec 6, 2001
63
US
I want this script to run if the server is rebooted. I can run it from the command line and it starts fine. Could someone tell me what's wrong.
Code:
#!/bin/bash

#This will set environment controls for Web to go and Start the processes.

webpid=`ps -ax|grep web|grep -v grep|gawk '{print $1}'`
if [[ -s $webpid ]]
then
echo "Webtogo already started"
else
ORACLE_BASE=/kw/01/app/oracle;export ORACLE_BASE
ORACLE_HOME=/kw/01/app/oracle/product/9.2.0;export ORACLE_HOME
ORACLE_SID=ora91;export ORACLE_SID
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH
TNS_ADMIN=$ORACLE_HOME/networking;export TNS_ADMIN
JAVA13_HOME=/usr/java/jdk1.3.1_06;export JAVA13_HOME
PATH=$ORACLE_HOME:$ORACLE_HOME/bin:$PATH;export PATH
#echo $ORACLE_HOME
su - oracle -c /kw/01/app/oracle/product/9.2.0/mobile/server/bin/webtogo &
#else
#echo "Webtogo already started"
fi
Thanks
Jesse
 
hi,

where did you put this script? If you want put that script into rc.local file. Or if you want put into run-level directory. What is our default run-level? If you want to use this you need to create start/stop script.

regards,
feroz
 
The default run level is 5. I put the script in /etc/rc5.d.
 
hi,

ok, you need to create script to start it. refer to any script within rc5.d. you filename should start with Sfilename and to stop using Kfilename.

regards,
feroz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top