Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On different Linux boxes, I see different behavior with respect to SSH sessions hanging on exit when there are background jobs running.

If I do exactly the same thing

$ for f in 1 2 3 4 5; do echo $f >> output; sleep 5; done &

$ exit

One will hang until the whole command is finished - which I expect - and the other will exit immediately but leave the command running.

I am aware of how to prevent the session from hanging (screen or redirecting console input/output to or from /dev/null) - what I want to understand is why one of my servers is NOT hanging like I expected.

Was there a version of OpenSSH where the behavior changed? The one that hangs is OpenSSH 3.9p1, the one that doesn't hang is OpenSSH 4.3p2.

Both are using bash as default login shell, and I confirmed huponexit option is off in both cases.

share|improve this question
    
Doessah -v ... give you some hints about what sah is doing internally? –  ott-- Mar 19 '12 at 21:30

1 Answer 1

The article below may well explain your question http://www.snailbook.com/faq/background-jobs.auto.html

share|improve this answer
1  
That might. However, answers should be standalone - link rot happens, and should the site you've linked to go down, your answer will be useless. Try to summarise what the link is, at the very least and how and why that link is relevant –  Journeyman Geek May 29 '12 at 7:36

Your Answer

 
discard

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.