ash endless loop after ssh client is killed

Alexander Kriegisch Alexander at Kriegisch.name
Sat Apr 21 23:13:25 UTC 2007


> As to ash's problem, my current guess it's xtcsetpgrp:
> 
>                 /* turning job control off */
>                 fd = ttyfd;
>                 pgrp = initialpgrp;
>                 xtcsetpgrp(fd, pgrp);  <===========
>                 setpgid(0, pgrp);
>                 setsignal(SIGTSTP);
>                 setsignal(SIGTTOU);
>                 setsignal(SIGTTIN);
> (...)
> Try simply replacing xtcsetpgrp call with tcsetpgrp, does that work?


No, it does not. It seems to solve the problem that the telnet window to
the first terminal is not closed automatically, but for the "kill
client" problem it seems to be useless. The remaining "sh" process still
goes up to 100% CPU. The first quick fix (which you said to possible
have negative side-effects) worked like a charm though, as far as I
could tell. In which situation would the other one be problematic? Can
you give me a shell script example I could reproduce on my box?

Cheers
Alexander



More information about the busybox mailing list