From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: Lost socket for detached Emacs, how to regain control? Date: Fri, 7 Nov 2008 06:54:39 -0800 (PST) Message-ID: <200811071454.mA7Esdaa013770@mothra.ics.uci.edu> References: <18704.27377.815630.316648@a1ihome1.kph.uni-mainz.de> <18707.58574.606841.540012@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226069716 26241 80.91.229.12 (7 Nov 2008 14:55:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2008 14:55:16 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 07 15:56:15 2008 connect(): Connection refused 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 1KySko-0007wV-5K for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2008 15:56:06 +0100 Original-Received: from localhost ([127.0.0.1]:46955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KySjg-0005sB-SQ for ged-emacs-devel@m.gmane.org; Fri, 07 Nov 2008 09:54:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KySjc-0005rw-Uu for emacs-devel@gnu.org; Fri, 07 Nov 2008 09:54:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KySjb-0005rb-Fj for emacs-devel@gnu.org; Fri, 07 Nov 2008 09:54:51 -0500 Original-Received: from [199.232.76.173] (port=49034 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KySjb-0005rY-9u for emacs-devel@gnu.org; Fri, 07 Nov 2008 09:54:51 -0500 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:48166) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1KySja-00057t-M9 for emacs-devel@gnu.org; Fri, 07 Nov 2008 09:54:51 -0500 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id mA7Ese7Q000700; Fri, 7 Nov 2008 06:54:40 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mA7Esdaa013770; Fri, 7 Nov 2008 06:54:39 -0800 (PST) In-Reply-To: <18707.58574.606841.540012@a1ihome1.kph.uni-mainz.de> (Ulrich Mueller's message of "Fri, 7 Nov 2008 07:48:46 +0100") Original-Lines: 24 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mA7Ese7Q000700 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:105446 Archived-At: Ulrich Mueller writes: > >>>>> On Wed, 05 Nov 2008, Stefan Monnier wrote: > > >> Consider the following scenario: > >> - emacs --daemon is running in the background without any open frame > >> - server-start is also called in another Emacs process > > >> Now there is no more way to connect to the detached Emacs. (Or am I > >> missing something?) > > >> Maybe it would be feasible to add a recovery mechanism for such a > >> case, like binding [sigusr1] to server-start? > > > That would be easy to do, indeed. Another option is for server-start > > to try and detect that there's already an active socket (using > > server-running-p) and refuse to start. > > Or both? The server process or socket could be non-functional for other > reasons. Like a silly cron job removing the socket from /tmp. I've had a [sigusr2] binding to server-start in my .emacs for a long time for exactly that reason. It has been very useful quite a few times.