Public bug reported:

When the default shell is Bash (which is the default shell)
Guake.delete_shell() incorrectly uses SIGTERM to signal Bash to
terminate, gives it 3 seconds, then uses SIGKILL.

Because Bash does not answer to SIGTERM this results in the Shell being
killed without closing down correctly. Amongst other things this results
in the Bash history file not being saved.

When the shell is Bash SIGHUP  should be used.

I have investigated this after supporting a user in #ubuntu that thought
that their deletion of ~/.bash_history was the reason for their Bash
shell no longer saving the history. On discovering Guake was the GUI
terminal emulator investigation showed it is doing:

def Guake.delete_shell(this, pid)
...
    os.kill(pid, signal.SIGTERM)


"man bash" "/^SIGNALS"

When bash is interactive, in the absence of any traps, it ignores SIGTERM (so 
that kill 0 does not kill  an  interacā€
       tive  shell),  and  SIGINT  is  caught  and  handled (so that the wait 
builtin is interruptible).  In all cases, bash
       ignores SIGQUIT. 
...
The  shell exits by default upon receipt of a SIGHUP.  Before exiting, an 
interactive shell resends the SIGHUP to all
       jobs, running or stopped.  Stopped jobs are sent SIGCONT to ensure that 
they receive  the  SIGHUP.
...

** Affects: guake (Ubuntu)
     Importance: Low
         Status: Triaged

** Changed in: guake (Ubuntu)
       Status: New => Triaged

** Changed in: guake (Ubuntu)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1347975

Title:
  Using incorrect signal to terminate Bash shell

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/guake/+bug/1347975/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to