From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs daemon doesn't terminate on SIGTERM any more Date: Sat, 23 Oct 2010 10:59:07 +0200 Message-ID: <4CC2A3DB.2090904@swipnet.se> References: <19649.19677.433824.461239@a1i15.kph.uni-mainz.de> <19650.5497.137779.175728@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1287824380 9702 80.91.229.12 (23 Oct 2010 08:59:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Oct 2010 08:59:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 23 10:59:38 2010 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.69) (envelope-from ) id 1P9Zwk-0002BT-BL for ged-emacs-devel@m.gmane.org; Sat, 23 Oct 2010 10:59:35 +0200 Original-Received: from localhost ([127.0.0.1]:40322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9Zwe-0005Jb-9B for ged-emacs-devel@m.gmane.org; Sat, 23 Oct 2010 04:59:20 -0400 Original-Received: from [140.186.70.92] (port=41574 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9ZwX-0005JW-US for emacs-devel@gnu.org; Sat, 23 Oct 2010 04:59:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9ZwW-0003mG-Kp for emacs-devel@gnu.org; Sat, 23 Oct 2010 04:59:13 -0400 Original-Received: from smtprelay-h32.telenor.se ([213.150.131.5]:47154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9ZwW-0003ld-Fd for emacs-devel@gnu.org; Sat, 23 Oct 2010 04:59:12 -0400 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id F0A19E8ACF for ; Sat, 23 Oct 2010 10:59:07 +0200 (CEST) X-SENDER-IP: [85.225.45.100] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmoxAINAwkxV4S1kPGdsb2JhbACHcZl5DAEBAQE1LbpdhUgEjVE X-IronPort-AV: E=Sophos;i="4.58,227,1286143200"; d="scan'208";a="142999854" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb2.telenor.se with ESMTP; 23 Oct 2010 10:59:07 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 1AA9B7FA05A; Sat, 23 Oct 2010 10:59:07 +0200 (CEST) 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 In-Reply-To: <19650.5497.137779.175728@a1i15.kph.uni-mainz.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:132015 Archived-At: 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 > >> 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.