You can still find /usr/bin/nohup, but bash now automatically nohups all background jobs. Try this from a new terminal window:
$ { sleep 20; echo DONE > /tmp/OUT; } & sleep 1; exitThe window will die, but if you look in another window (or, after 20 seconds, in /tmp/OUT), you'll see the backgrounded job continues.
I say this because I still see admonitions to nohup jobs.
1 comment:
That's how bash is behaving, for sure--I just tested it. But is this possibly a bug, not a feature?
Via Wikipedia, I found this: https://bugzilla.mindrot.org/show_bug.cgi?id=396
It seems the "correct" way to leave a job running when you log out, if you didn't nohup it to begin with, is to use disown -h.
This raises the question of how to recover the output of the job, though--whether you use disown or simply kill the terminal window. Any ideas?
Post a Comment