emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs daemon doesn't terminate on SIGTERM any more


From: Jan Djärv
Subject: Re: Emacs daemon doesn't terminate on SIGTERM any more
Date: Sat, 23 Oct 2010 10:59:07 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.11) Gecko/20101004 Thunderbird/3.1.5



Ulrich Mueller skrev 2010-10-23 00.51:
On Fri, 22 Oct 2010, Ulrich Mueller wrote:

Then I try to kill it from another terminal window:

    $ kill<pid of emacs process>

With Emacs 23.2 the process would properly terminate now. The BZR
version asks for interactive input in the open terminal frame instead:

     The current server still has clients; delete them? (yes or no)

Therefore the process doesn't terminate.

The problem is caused by the following change (introduced in May):

--- a/src/emacs.c
+++ b/src/emacs.c
@@ -385,6 +386,9 @@ fatal_error_signal (sig)
      {
        fatal_error_in_progress = 1;

+      if (sig == SIGTERM || sig == SIGHUP)
+        Fkill_emacs (make_number (sig));
+
        shut_down_emacs (sig, 0, Qnil);
      }


This was done so that kill-emacs-hook is run. For example, desktop.el will then save its desktop when logging out from Gnome/KDE.

What Emacs needs is some sort of notion of when user interaction is not OK. For SIGTERM it is almost never ok, as it might be the window manager/system/whatever that is shutting down. Even desktop.el will try to ask questions sometimes (i.e. desktop-save is set but there is no desktop file yet), which is annoying. Maybe introduce some interaction-ok-p predicate?

        Jan D.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]