emacs-devel
[Top][All Lists]
Advanced

[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: Dan Nicolaescu
Subject: Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM
Date: Fri, 23 Jan 2009 12:33:19 -0800 (PST)

Eli Zaretskii <address@hidden> writes:

  > > From: Tassilo Horn <address@hidden>
  > > Cc: Stefan Monnier <address@hidden>,  address@hidden
  > > Date: Fri, 23 Jan 2009 16:58:03 +0100
  > > 
  > > Init or start-stop-daemon do that.
  > > 
  > > > Why can't they use SIGUSRn?
  > > 
  > > Because SIGUSRn has different meanings across applications, so the only
  > > reliable way to terminate a program is "kill <pid>" which send a
  > > SIGTERM.
  > 
  > You can run your own script when the machine is shut down, can't you?
  > Then have that script deliver a SIGUSRn signal to Emacs and wait a few
  > moments for it to shut down peacefully.

IMHO we should not teach users to even do that.  

The safest thing to do is run
 emacsclient --eval "(save-buffers-kill-emacs)".

Relying on things getting saved properly on SIGTERM/SIGUSR* is just not a good
idea.




reply via email to

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