Why my script is always "stopped" ?
I let a script A call script B.
I used Code:
nohup A &>/tmp/log & However A is always "Stopped", while B is running correctly. Anybody knows why? thanks! |
Is this homework from school?
Although you failed to include details the answer to your question appears to be trivially simple. You are not supposed to post homework questions. |
My friend, this is not homework. I have been working on Linux for 2 years. This is the problem that drives me crazy.
Script A: Code:
#do nothing but call B Code:
# do some fancy things, takes about 1 hour to finish Code:
nohup a.sh &>/tmp/log & Quote:
|
BTW, if I don't use nohup and backgrounding, it's OK. i.e. if I use
Code:
a.sh |
anybody has a clue?
|
The process in background loose connection with the standard input. Why you have to use nohup and background? And why you have to use a script to do that? Can't you simply do ssh remotehost, launch the script b.sh on the remote machine (using nohup and background), then disconnect and go home? Or eventually use screen to detach the process and reconnect later to check the output.
|
Thanks lot. Script A is a wrapper. It also does other misc things, like logging.
You mentioned the process in background loose connection with STDIN, whose STDIN? Would you elaborate more? Thanks again. Quote:
|
Does the script a.sh expect something from standard input? For example, the password for the ssh connection? If you put the script in background, it is detached from the terminal and you cannot send input to the script, if required. In that case the script stop its execution, waiting for something that can't be fed.
|
All times are GMT -5. The time now is 04:35 PM. |