Bug 159363 - gnome-pty-helper doesn't clean up gnome-terminals' utmp/wtmp entries when killed
gnome-pty-helper doesn't clean up gnome-terminals' utmp/wtmp entries when killed
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: vte (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
Depends On:
Blocks: 170445
  Show dependency treegraph
Reported: 2005-06-01 18:32 EDT by David Lehman
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-24 07:14:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Catch SIGHUP and SIGTERM so we can clean up login records (582 bytes, patch)
2005-06-01 18:32 EDT, David Lehman
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Bugzilla 312373 None None None Never

  None (edit)
Description David Lehman 2005-06-01 18:32:16 EDT
Created attachment 115067 [details]
Catch SIGHUP and SIGTERM so we can clean up login records
Comment 1 David Lehman 2005-06-01 18:32:16 EDT
Description of problem:
The utmp entries of gnome-terminals run under vnc don't get cleaned up if the
vnc session is killed via 'vncserver -kill <display>'. This is because vncserver
doesn't just kill the gnome-terminals as a user would, but rather kills all
child processes, which includes gnome-pty-helper. gnome-pty-helper just dies,
leaving the stale utmp/wtmp entries to potentially confuse subsequent users of
'/bin/who -u', which isn't supposed to show entries for dead processes.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
(This occurs naturally when a vncserver running gnome-terminals is killed using
'vncserver -kill <display number>' but the below process is much simpler)
1. start a gnome-terminal (note the tty)
2. kill both the gnome-terminal and gnome-pty-helper with SIGHUP
3. check 'who -u' output
Actual results:
The entry for the gnome-terminal is still there although the terminal is gone

Expected results:
No 'who -u' output for dead gnome-terminal

Additional info:
I've seen the gnome-terminal get SIGPIPE and as a result send SIGTERM to
gnome-pty-helper and I've also seen gnome-pty-helper get SIGHUP from (I guess)
Comment 2 Bastien Nocera 2005-08-02 11:08:25 EDT
Pushed upstream:
Comment 3 Bastien Nocera 2005-08-05 04:27:53 EDT
Patch was committed to HEAD upstream.
Comment 5 Ray Strode [halfline] 2005-10-24 13:10:08 EDT
Hi guys,

That patch looks a little off.  shutdown_helper() probably can't be called
legally from a signal handler.  If it can't then the patch could lead to all
sorts of weirdnesses like segfaults, process lock ups, etc.
Comment 6 Bastien Nocera 2005-10-24 13:34:56 EDT
And some sucker committed that upstream already ;)

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