Ash + telnetd: telnet client hangs after exit

Denys Vlasenko vda.linux at googlemail.com
Mon Oct 15 15:11:37 UTC 2007


On Monday 15 October 2007 15:15, Alexander Kriegisch wrote:
> BTW, the output "ps" output diff looks like this on i386:
> 
> $ diff -U0 ps1.txt ps2.txt
> --- ps1.txt     2007-10-15 16:13:06.000000000 +0200
> +++ ps2.txt     2007-10-15 16:13:25.000000000 +0200
> @@ -130 +129,0 @@
> -root     31704 31643  0 16:10 ?        00:00:00 [login] <defunct>

Aha. You have a login which does not exec shell, it spawns it
as a child. When shell exits, login exits too.

What looks strange to me is that you see a _zombie_ login.
It means that it exited, but is not waited for yet.

How come telnetd doesn't see EOF from login's fd? It *exited*,
and that implicitly closes all fds! I'm puzzled.

Two questions.

(1) can you check PPID of zombie login? Is it 1 or <telnetd's PID>?
(2) is it possible that you start telnetd so that it inherits
    "ignore SIGCHLD" from the parent? Try adding this line
    after signal(SIGPIPE, SIG_IGN):

     signal(SIGPIPE, SIG_IGN);
+    signal(SIGCHLD, SIG_DFL);

Unrelated note: I looked at telnetd source and tightened up
some loose ends. Can you test this patch? (I don't think
it will help with this particular problem, though...)
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8.patch
Type: text/x-diff
Size: 16413 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20071015/9fd1709b/attachment-0002.bin 


More information about the busybox mailing list