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!

Scripting help (urgent)

Status
Not open for further replies.

cgswong

MIS
Nov 27, 2000
202
US
Hi all, I'm having a little trouble with a script I wrote. The script shuts down all the databases and does a backup of necessary file systems. After the backup the databases are started back with a script the vendor wrote. The problem is that when their script runs it doesn't terminate and give back the command line. It does what its supposed to do but does not give back the command line, it just sits their and I have to kill the process, or break out to end the script.

Can someone tell me what's wrong? Any help is appreciated, thanks.

- Stu
 
Usually when I see this happen the script is waiting for some input. Sometimes it's a &quot;Press <Return> to continue&quot; type message, sometimes it's the actual backup command saying &quot;Put a new tape in the drive and press <Return> to continue&quot;

Check that the data you are backing up will actually fit on a tape, and check if the backup script is using any &quot;read&quot; commands to read keyboard input.

Hope this helps.
 
No, it's not that the backup doesn't finish. I've made sure that the backup finishes before running the vendor script. I've given the vendor script a look over and it appears okay. Any other ideas?

- Stu
 
Can you post the script, or an extract of it? It's possible a judiciously placed 'exit' might work?
 
Here's an extract of my script:

/etc/rc3.d/S999ict start
#lp -s -d $LOG_PRT $LOG_FILE
exit 0

The file S999ict is the vendor script located in a different directory, so the above is a link to the actual file located elsewhere.

- Stu
 
Hmmm. Don't really know the answer, but if the owner of the application is a specific user, would it be worth trying an su - <user> -c &quot;<explicit pathname to start application>&quot; in your script so that the process is actually started outwith the script itself? This certainly works in Oracle applications which we have designed. Hope this helps.

 
Try sticking set -xv at the start of the vendor script, that should give you some extended debug and hopefully give you an idea of where it's hanging

 
hi...
scripts usually use the >/dev/null 2>&1 at the end of a commandline just to ignore all msgs + errormsgs. If this is the case, change the /dev/null to something like /tmp/script.log.
Then run the script to see if there is any valuable information generated or any errormsgs.
its just a simple thought.. :)

good luck
/DG
 
I've looked through the vendor's script and it doesn't have the &quot;2>&1&quot; that I'm familiar with. It has &quot;1>&2&quot;, could this be the problem?

Oh, the vendor's script has to run as root cause they have 'su - <user> -c <progrm>' in their script. The weird thing is that the last thing the vendor's script does is to display a summary of all processes which it has started, and it works fine from the comand line. But it just sits their in the script.

I'll try the other stuff though. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top