[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SI
From: |
Eli Zaretskii |
Subject: |
Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM |
Date: |
Fri, 23 Jan 2009 17:25:31 +0200 |
> From: "Stefan Monnier" <address@hidden>
> Cc: <address@hidden>,
> <address@hidden>
> Date: Thu, 22 Jan 2009 16:16:37 -0500
>
> > I'm more worried by the possibility that they run Lisp code when Emacs
> > is in unstable state.
>
> The only sane way to implement it is via an event, just like SIGUSRn, so
> I don't see why there would be such a risk. The risk would rather be
> the opposite: that by delaying execution to a safe time, we may delay it
> indefinitely.
We may also delay it indefinitely if we run Lisp, because that could
infloop, especially if our internal data structures are unstable.
> I'm sure I understand what you mean by "enough", because I'm not sure
> what you think is necessary. To me what is necessary is:
> 1 - don't lose data.
> 2 - exit reasonably promptly.
> So doing the autosaves before running the hook should make sure
> 1 is preserved. But running the hook may indeed make us lose 2.
> Is that what you meant by "not enough"?
>
> To keep number 2, we could schedule a SIGALRM so as to forcefully exit
> after a timeout, in case running the hook doesn't happen quickly enough.
On balance, I would leave things as they are, i.e. don't run
kill-emacs-hook when we get SIGTERM. After all, we are being killed,
so only the minimum necessary cleanup should be in order.
If SIGTERM is used to programmatically shut down Emacs, I think it's
rather a conceptual bug in whatever uses SIGTERM for that purpose.
Why can't they use SIGUSRn?
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, (continued)
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Andreas Schwab, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Richard M Stallman, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Stefan Monnier, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Stefan Monnier, 2009/01/22
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM,
Eli Zaretskii <=
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Tassilo Horn, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, David De La Harpe Golden, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Tassilo Horn, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Lennart Borgman, 2009/01/23
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Tassilo Horn, 2009/01/24
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/24
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Miles Bader, 2009/01/24
- Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM, Eli Zaretskii, 2009/01/24