Bug 89653 - When closing telnet, child processes are not killed
Summary: When closing telnet, child processes are not killed
Status: CLOSED DUPLICATE of bug 59029
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: telnet
Version: 7.2
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2003-04-25 15:18 UTC by Matthew Wygant
Modified: 2007-04-18 16:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-02-21 18:52:49 UTC

Attachments (Terms of Use)

Description Matthew Wygant 2003-04-25 15:18:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020826

Description of problem:
When exiting the telnet session (by closing the terminal and NOT typing exit) if
there are any child processes running in the background, they become session
zombies and eat up 100% of the processor.  If exit is typed, this does not
occur, if SSH is used, this does not occur.  This occurs on a RH8 server as
well.  Cannot use SSH, customer base too large to retrain to type exit.  Tried
freshen install of telnet-server, got latest util-linux, did up2date on all
packages and problem still exists.  

Version-Release number of selected component (if applicable):
default version of telnet-server, updated util-linux-2.11z

How reproducible:

Steps to Reproduce:
1.open telnet to a RH7.2 server
2.start jobs/processes
3.close terminal by closing terminal, not exit
4.run top to see CPU get eaten up 

Actual Results:  CPU goes to 100% within a few minutes.

Expected Results:  Child processes get SIGHUP and die a graceful death.

Additional info:

Comment 1 Harald Hoyer 2003-04-25 15:51:17 UTC
ok, here is the problem:
- telnetd exits
- kernel sends SIGHUP to terminal sessions leader
- login has forked itsself because of PAM
- the parent login process ignores SIGHUP
- the child login (now bash) does not get SIGHUP
--> login and bash stay alive after telnetd exists

problem is in util-linux-2.11n-5 login.c(1135):
    } else if (childPid) {
       /* parent - wait for child to finish, then cleanup session */
       /* ioctl(0, TIOCNOTTY, NULL); */
       signal(SIGHUP, SIG_IGN);
       signal(SIGINT, SIG_IGN);
       signal(SIGQUIT, SIG_IGN);
       signal(SIGTERM, SIG_IGN);


- catch the signal and kill(childPid, SIGHUP)
- or make the child the session leader (setsid())

As per #54741, this is fixed in util-linux-2.11n-8

*** This bug has been marked as a duplicate of 59029 ***

Comment 2 Red Hat Bugzilla 2006-02-21 18:52:49 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.