From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM Date: Sat, 24 Jan 2009 00:13:13 +0100 Message-ID: References: <87prihxeu5.fsf@thinkpad.tsdh.de> <87ab9iggl0.fsf@thinkpad.tsdh.de> <497A20D6.4050208@harpegolden.net> <87vds5fx0j.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232752410 10096 80.91.229.12 (23 Jan 2009 23:13:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 23:13:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 24 00:14:43 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LQVEY-0002b7-EC for ged-emacs-devel@m.gmane.org; Sat, 24 Jan 2009 00:14:42 +0100 Original-Received: from localhost ([127.0.0.1]:49226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQVDG-0000BY-KL for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 18:13:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQVDB-0000BJ-RO for emacs-devel@gnu.org; Fri, 23 Jan 2009 18:13:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQVDA-00009y-Ir for emacs-devel@gnu.org; Fri, 23 Jan 2009 18:13:16 -0500 Original-Received: from [199.232.76.173] (port=57499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQVDA-00009g-D5 for emacs-devel@gnu.org; Fri, 23 Jan 2009 18:13:16 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.158]:7973) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQVDA-0005iT-0i for emacs-devel@gnu.org; Fri, 23 Jan 2009 18:13:16 -0500 Original-Received: by fg-out-1718.google.com with SMTP id l26so2834974fgb.30 for ; Fri, 23 Jan 2009 15:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4MNjS4Fgd1gZ1ne4Qea32z3tgm1ZK0yhn5BSzxiHfN0=; b=mdtY45V6NcoXT3ImJ6UoVuFFnkMJYhi4uF9XM9FVBWvqIANm0VxuwL8ANzV2Ar6yCg zkIE8hZUhvnKw7D9in66FqBU0cUtK6aSYruSt1VO5WUKrG1KTC46PoAQBPefUxHlVRu9 Dk3x4KwLLOLdQ8vayHc3/2KoGpuulz7F5wiPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QiiAnvkCTvpYFUnGLP9g0aVTv8jrA8H5bTEfnJT9AxU3Q09qQbgaiu+jivBNpJ27d7 GnRNPsLkK12L3gRaQ/Jy4+DmHk/xUaeJUYg699swFXJUwnAMT3139j1XHVygeJhmrr3N gDmK45rgrVO05mUo68hZYE505vFedPza7OmTU= Original-Received: by 10.86.54.3 with SMTP id c3mr37077fga.31.1232752393743; Fri, 23 Jan 2009 15:13:13 -0800 (PST) In-Reply-To: <87vds5fx0j.fsf@thinkpad.tsdh.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108170 Archived-At: On Sat, Jan 24, 2009 at 12:00 AM, Tassilo Horn wrote: > Eli Zaretskii writes: > >>> Uh, but SIGTERM IS "please shutdown". Sorry, but _conventionally_ >>> automated systems* will issue a SIGTERM to allow graceful shutdown >> >> And Emacs obeys this. The argument is not whether Emacs obeys >> SIGTERM, the argument is whether user-defined hooks should run when we >> are hit with SIGTERM. > > I don't get what could be so dangerous running a user-defined hook after > all buffers have been saved, as Stefan suggested. The worst case I can > imagine is that one of the functions accesses a file but is too slow, > and a subsequent SIGKILL causes some data loss. > > But with the current way *every* SIGTERM causes data loss for me. I did not follow this closely, but maybe this is hitting a problem in GNU/Linux? I compare with w32 where the shutdown process waits if some program has problem exiting. Regarding Stefans suggestion the only useful thing to do is AFAICS to save some things to a file, so yes, there might be a problem - but probably not worse than doing nothing.