Bash script hangs upon starting another script in the background
Hi,
I am trying to create a program that I will use to start a vendor application, but once I kick off that application my script just hangs... here is what the relevant part of my script looks like: pid=`/usr/bin/nohup./hawkagent_$bwdom &` exit 0 When executing this with the -x option I see my script is just hanging on this line: ++ ./hawkagent_BWDEXPMGMT Any ideas? |
I think it has to do with the fact that you are assigning its output to a variable (assuming those are backticks in your post). A quickie experiment I just ran (using ls and sleep) seems to indicate that in this case, even though the process does get run in the background, the script won't proceed until it can assign the value.
|
Looks like you're working with some batch system. BWDEXPMGMT looks like a maestro job name to me! MGMT = management? EXP = export? BWD? Hmm. I've spent way too long in the past trying to work out the purpose of some undocumented job from the job name. *sigh*
ANYhow... There are a few things which are wrong here.
Code:
nohup /usr/bin/nohup ./hawkagent_$bwdom & |
Found a solution
The way to resolve it is as follows:
(./hawkagent_BWDEXPMGMT > $Logs/Hawk.log 2>&1 &) & Double backgrounding of process seems to work. |
Quote:
|
All times are GMT -5. The time now is 04:36 AM. |