Created attachment 115067 [details] Catch SIGHUP and SIGTERM so we can clean up login records
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.
Pushed upstream: http://bugzilla.gnome.org/show_bug.cgi?id=312373
Patch was committed to HEAD upstream.
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.
And some sucker committed that upstream already ;)