Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script that calls a subscript and attempts to release/disown this script so that Jenkins calling the script can complete successfully. It seems to release the script on the command line, so I can log out or execute other scripts when on the command line (SSH), but Jenkins hangs waiting for the released script to finish. Is there a way around it?


disown -h

echo "Done"
exit 0


while [ false ]; do
  echo "Still Working"
  sleep "5s"

When doing this, Jenkins just hangs endlessly until I kill the subscr execution.

share|improve this question
up vote 2 down vote accepted

There are two ways I could think of to do this.


The command nohup will run a subcommand completely detached from your terminal, and send its output to a file:

$ nohup ls
appending output to nohup.out
$ cat nohup.out 

GNU screen

GNU screen can serve the same function in this context, of running a command with the output sent elsewhere. It also has the bonus feature of being able to reattach to the stdin and stdout of the process later on without restarting it if necessary. (It's hard to demo screen in a text buffer.)

share|improve this answer
Thanks, this seems to be an issue with the wrapper tha executes Jenkins scripts. I was able to fix this particular need by nohup from the ssh command. I've tested the above and it does work when calling directly from ssh – Jeff Ancel Dec 20 '11 at 15:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.