The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
why shell script fails tahir23 Shell Programming and Scripting 4 08-21-2008 07:37 AM
#!/bin/sh script fails at StringA | tr "[x]" "[y]" by_tg UNIX for Dummies Questions & Answers 3 02-22-2008 09:17 AM
SCP fails sometimes vipinc AIX 10 07-17-2007 11:38 PM
Shell Script fails with "can't connect to client" sseenu79 HP-UX 2 12-20-2006 07:47 AM
Script fails JStone Shell Programming and Scripting 8 08-09-2006 09:00 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-20-2008
Registered User
 

Join Date: Aug 2008
Posts: 25
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.
Reply With Quote
Forum Sponsor
  #2  
Old 08-21-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 920
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
Reply With Quote
  #3  
Old 08-21-2008
Registered User
 

Join Date: Aug 2008
Posts: 25
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 12:50 AM. Reason: Please use "code"-tags when posting a script.
Reply With Quote
  #4  
Old 08-21-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 920
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?
Reply With Quote
  #5  
Old 08-21-2008
Registered User
 

Join Date: Aug 2008
Posts: 25
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 .
Reply With Quote
  #6  
Old 08-21-2008
Registered User
 

Join Date: Aug 2008
Posts: 25
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 ..
Reply With Quote
  #7  
Old 08-21-2008
otheus's Avatar
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 605
Quote:
Originally Posted by tahir23 View Post
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??
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0