Using incorrect signal to terminate Bash shell

Bug #1347975 reported by TJ
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
guake (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

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

TJ (tj)
Changed in guake (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in guake (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Filip Sohajek (filip-sohajek)
Revision history for this message
TJ (tj) wrote :
Revision history for this message
Filip Sohajek (filip-sohajek-deactivatedaccount) wrote :

Fixed upstream

tags: added: patch-accepted-upstream
Changed in guake (Ubuntu):
status: In Progress → Confirmed
assignee: Filip Sohajek (filip-sohajek) → nobody
Revision history for this message
Robert Matusewicz (matekm) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest stable version of Ubuntu.

Changed in guake (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.