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
[root@~]# ./ &

I don't know if $! will terminate if I just log out immediately?

share|improve this question
Depends on if huponexit is set, see… – Kyle Brandt Mar 12 '10 at 13:55

disown the job and it won't. If it's the only thing running in the background, you'd do disown %1. Otherwise it would be the job number given in square brackets when you start the job.

share|improve this answer
Who is right,you or @Kyle Brandt? – vps Mar 12 '10 at 14:05
They're both right. There's more to it than you understand. See also:… disown forks the process from the shell, so it won't be sent a SIGHUP on exit even if huponexit is on. – Warner Mar 12 '10 at 14:15
I am right times infinity squared + 2. You want disown the job if you can. Ideally I would recommend that you run the job with screen or maybe nohup. – Kyle Brandt Mar 12 '10 at 14:16

I'm not sure the exact answer to this question.

I do know that to detach from the console requires more than just redirecting to /dev/null. You need to consider using setsid as well as redirecting 1>/dev/null and 2>/dev/null.

share|improve this answer

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.