Super User is a question and answer site for computer enthusiasts and power users. 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

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

The article below may well explain your question

share|improve this answer
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .