Bug 159363

Summary: gnome-pty-helper doesn't clean up gnome-terminals' utmp/wtmp entries when killed
Product: Red Hat Enterprise Linux 3 Reporter: David Lehman <dlehman>
Component: vteAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: RHEL3U7NAK
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-24 12:14:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 170445    
Attachments:
Description Flags
Catch SIGHUP and SIGTERM so we can clean up login records none

Description David Lehman 2005-06-01 22:32:16 UTC
Created attachment 115067 [details]
Catch SIGHUP and SIGTERM so we can clean up login records

Comment 1 David Lehman 2005-06-01 22:32:16 UTC
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):
vte-0.11.10-11

How reproducible:
Always

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)
vncserver.

Comment 2 Bastien Nocera 2005-08-02 15:08:25 UTC
Pushed upstream:
http://bugzilla.gnome.org/show_bug.cgi?id=312373

Comment 3 Bastien Nocera 2005-08-05 08:27:53 UTC
Patch was committed to HEAD upstream.

Comment 5 Ray Strode [halfline] 2005-10-24 17:10:08 UTC
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 17:34:56 UTC
And some sucker committed that upstream already ;)