job control

Some tips on job control from Peter Van Buren, Stein Lab system admin:

Background: I had asked Peter about how to keep jobs running even when a shell exits. Backgrounding a process is not always sufficient.

Peter writes:
It’s probably your shell exiting that is sending signals to your jobs. If you are running bash on your laptop, you can try using the nohup command “nohup myjob &”. That should make the job immune to hangup signals from exiting shells. The nohup command, by default, sends output to a file called nohup.out.

I think you can use redirection with nohup. You can also try running tcsh, which I believe doesn’t send HUP signals to child processes. There is a also a bash builtin command “disown”. If you run “disown -h job#”, signals should no longer be sent to that job if the shell exits.

Leave a Reply