Hallo, In message <_A3388@delegate-en.ML_> on 07/12/06(20:03:04) I wrote: | |The most important trick is to fork() twice, so the process becomes its | |own process group and is detached from any terminal and process group. | |I think it is the very functionarity of setsid() and it works as expected |on BSD. I tested to close the standard input after setsid() as the |enclosed patch, and it solved the problem of SSH on Linuxes I have |(Debian3.1 and RedHat9). I tested fork() after setsid() but it does not solved the problem. It might not be the problem of daemonizing but it seems just because sshd (left as "sshd: user@notty") does not finish until the pty is closed completely, possibly for security consideration (?) Or it might be just a bug of ssh: <URL:http://lists.debian.org/debian-ssh/2005/02/msg00012.html> > Summary: > Lot of command-only sshd childs hangs witch kernel 2.6 > > Description: > on Debian Linux ( sarge ) with kernel 2.6.9 hangs a non privileged > thread from sshd if esecuted command returns. Not every request hangs, > but a lot: Cheers, Yutaka -- 9 9 Yutaka Sato <pfqcabdyi-mxhgu43xz33w.ml@delegate.org> http://delegate.org/y.sato/ ( ~ ) National Institute of Advanced Industrial Science and Technology _< >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan Do the more with the less -- B. Fuller