why script fails sometime?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users why script fails sometime?
# 8  
Old 08-21-2008
The scripts mentioned here are the default start scripts for IBMs Websphere product. They themselves run a whole lot of commands and any of these commands can fail for some or the other reason.

In other words: nothing of the information you gave us so far is sufficient to find out the reason. our script calls four other scripts and this process probably never fails and never will fail. That does not mean, though, that all the scripts started this way will finish sucessfully - each of them could fail for some or other reason. I have worked with a server running Websphere once and i know that it can be tricky sometimes to find ot why it failed to start.

I fear it will boil down to thorough troubleshooting on your side to find out the reason. The following are just some (very general) suggestions which may or ma not help you find the problem.

- You run your script under bash instead of ksh. bash is not the systems default shell and hence using it a potential risk. While i suppose it won't make any difference it is on the safer side to use "/bin/ksh" instead of bash.

- Try inserting "set -x" at the start of the four mentioned scripts and capture the output to some file to see what is going on:

Code:
#!/bin/ksh
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh  >/tmp/start.1.log 2>&1
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh  >/tmp/start.2.log 2>&1
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1 >/tmp/start.3.log 2>&1
/opt/IBM/HTTPServer/bin/apachectl start >/tmp/start.4.log 2>&1

If something fails you can analyze the files /tmp/start[1-4].log then. This will not fix any problem itself, just help you analyze the situation when it happens.

I hope this helps.

bakunin
# 9  
Old 08-21-2008
Quote:
Do these scripts output any "interesting" information? Do the processes themselves keep logfiles??
sory i could't undestand "interesting" , problem not a joke?

This script auto starts the application server and apache on system stratup It works fine but some times it fails and the script does't start the application server or appache . means that script fails. have u nay idea , if then write .
thanks
# 10  
Old 08-21-2008
i have automated it using the procedure below

for example my scrip name is "autoscript.sh"

#!/bin/ksh
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh >/tmp/start.1.log 2>&1
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh >/tmp/start.2.log 2>&1
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1 >/tmp/start.3.log 2>&1
/opt/IBM/HTTPServer/bin/apachectl start >/tmp/start.4.log 2>&1


After writing this script . i have copied it into /etc/init.d/ directory and then i have created a link in /etc/rc3.d/ directory using command " ln -s /etc/init.d/autoscript.sh S99script

So this works fine but i don't know some times it stops working . May be there is some problem with application server or may be due to automation .
if u have any idea then write here.
Thanks
# 11  
Old 08-21-2008
Have you looked at the log files? What do they read like when the process fails?

Have yo inserted "set -x" or "set -xv" into the scripts mentioned in your script?

bakunin
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