why script fails sometime?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users why script fails sometime?
# 1  
Old 08-21-2008
why script fails sometime?

Hi,


I am trying to run a shell script on solaris,some time it works fine and some times it fails unexpectedly. There is a script called "autostart.sh" which automatically starts the Application server but some times the script fails to strat the application server. can anyone tell me what is the reason , why it dn't work properly .
The Script is ;
____________________________________________
#!/bin/bash
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/ ./startManager.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/ .startNode.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/ ./startServer.sh server1
/opt/IBM/HTTPServer/bin/ ./apachectl start
_______________________________________________


Thanks in advance.
# 2  
Old 08-21-2008
I'm surprised it ever works... why are there spaces between the directory name and the script name? Try making it like this:

Code:
#!/bin/bash
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1
/opt/IBM/HTTPServer/bin/apachectl start

# 3  
Old 08-21-2008
Thanks Annihilannic

Code:
#!/bin/bash
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/./startManager.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/.startNode.sh
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/./startServer.sh server1
/opt/IBM/HTTPServer/bin/./apachectl start


.......... Spaces are not in script , i know it will not work if there would be any space, i m sure that there is no error in this scrips and at this time script is running but some time it works and some time no.I have automate and it works on system stratup , I don't know why this problem occurs.

Last edited by bakunin; 08-21-2008 at 04:50 AM.. Reason: Please use "code"-tags when posting a script.
# 4  
Old 08-21-2008
When does it work and when does it not work? Does it work when you run it manually, but not when you system boots up? Or is it completely random... i.e. sometimes when you run it manually it works, sometimes it doesn't?
# 5  
Old 08-21-2008
Yes it runs manually and at startup as well . but some times it does't start all the services mentioned in the script . On system boot some times it works but some time does't .
# 6  
Old 08-21-2008
what could be the problem and why is works some time or why i does't work some times.
if u have any idea then write here. waiing for your reply .
Thank you ..
# 7  
Old 08-21-2008
Quote:
Originally Posted by tahir23
Yes it runs manually and at startup as well . but some times it does't start all the services mentioned in the script . On system boot some times it works but some time does't .
Do these scripts output any "interesting" information? Do the processes themselves keep logfiles??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

./ignite.sh script fails after 5 seconds

Hello, I am trying to run a make_net_recovery Ignite for a server in a 2 node cluster . But I do get some issues. VG "/dev/vg59" is not defined in file "/etc/lvmtab". VG "/dev/vg59" is not defined in file "/etc/lvmtab_p". save_config: Error - vg00 not in the volume/disk group ERROR: ... (0 Replies)
Discussion started by: velde_van_der_a
0 Replies

2. Shell Programming and Scripting

Script execution fails

hi, i am trying to run this script, getting below error, can some one help me in this Error: -bash: on_failure.sh: line 23: syntax error: unexpected end of file ======================================================== # CHANGE HISTORY # # YYYYMMDD Change by Desription # --------... (2 Replies)
Discussion started by: szs
2 Replies

3. Shell Programming and Scripting

Execute shell script even if the first script fails

All, I executing a perl script and shell script from a master shell script. i will execute the perl script first and have to execute the shell script after the completion of perl execution. Below is the code i use for it, script_root='/dev/scripts' /usr/bin/perl -S $script_root/test.pl;... (5 Replies)
Discussion started by: vel4ever
5 Replies

4. Shell Programming and Scripting

Script fails with ORA-20000 when run with su

Hi, I have a ksh script that runs as root ans issues several commands as a user differente from root as 'su <user> -c "command" ' . It works fine except for one step where the command executes sql statements. That command fails with ORA-20000. Now the strangest thing, if I place a read command... (5 Replies)
Discussion started by: naf
5 Replies

5. Shell Programming and Scripting

Stop execution of script if some condition fails

After my if condtion give rusult true then script should stop execution. Please advice...Thnaks in advance (1 Reply)
Discussion started by: vivek1489
1 Replies

6. Shell Programming and Scripting

crontab fails to run script

OS is Ubuntu 8.04.3. When I run the command: /usr/bin/syslogMailer < /etc/syslog.pipes/criticalMessagesFrom a bash shell it works and i receive an email as per the script however when run from crontab it does not work. Can anyone explain why and how to fix it? /usr/bin/syslogMailer... (4 Replies)
Discussion started by: jelloir
4 Replies

7. Shell Programming and Scripting

log file when the script fails !

i have a script that will retrive some info from database. The script is working fine but i have to add new feature in it when the script fails or retrive null result it should reflect in the log file. below the script AMR_Inactive.sh while read i do connect1=`sqlplus -silent... (3 Replies)
Discussion started by: ali560045
3 Replies

8. Shell Programming and Scripting

why shell script fails?

hi , i m trying to run a shell script automatically , some time it works fine but some time it fails , what could be the problem . If anybody have an idea about this problem then reply . Thanks in advacne (4 Replies)
Discussion started by: tahir23
4 Replies

9. Shell Programming and Scripting

why shell script fails

hi .. I have automate some process on unix through sehll script . but i don't know there is some problem in scripts, some time shell script works and some time it fails. so my query is that "Why shell script fails some times?" thanks (4 Replies)
Discussion started by: tahir23
4 Replies

10. Shell Programming and Scripting

Script fails

Hi, I am trying to install a package on solaris and one of the packaging scripts fail unexpectedly. There is a script called "checkinstall" which checks for the /opt space and aborts the installation if /opt is less than 100MB. In my case, even if /opt has enoguh space, the script fails. ... (8 Replies)
Discussion started by: JStone
8 Replies
Login or Register to Ask a Question