From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Re: emacs --daemon should provide a way to get its process id Date: Sat, 1 Nov 2008 18:33:30 +0100 Message-ID: <18700.37610.141752.354482@a1ihome1.kph.uni-mainz.de> References: <18699.23113.985700.25955@a1ihome1.kph.uni-mainz.de> <20280352.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225560838 4319 80.91.229.12 (1 Nov 2008 17:33:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2008 17:33:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: bwoster Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 01 18:35:00 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 1KwKNG-0004wO-W3 for ged-emacs-devel@m.gmane.org; Sat, 01 Nov 2008 18:34:59 +0100 Original-Received: from localhost ([127.0.0.1]:49491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwKMA-0000op-6U for ged-emacs-devel@m.gmane.org; Sat, 01 Nov 2008 13:33:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwKM4-0000nL-W0 for emacs-devel@gnu.org; Sat, 01 Nov 2008 13:33:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwKM2-0000n8-Tx for emacs-devel@gnu.org; Sat, 01 Nov 2008 13:33:44 -0400 Original-Received: from [199.232.76.173] (port=42202 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwKM2-0000n5-Of for emacs-devel@gnu.org; Sat, 01 Nov 2008 13:33:42 -0400 Original-Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:53049) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KwKM2-0000gi-BB for emacs-devel@gnu.org; Sat, 01 Nov 2008 13:33:42 -0400 Original-Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mA1HXUZ8012334; Sat, 1 Nov 2008 18:33:30 +0100 Original-Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1]) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mA1HXUO4008782; Sat, 1 Nov 2008 18:33:30 +0100 Original-Received: (from ulm@localhost) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mA1HXURM008777; Sat, 1 Nov 2008 18:33:30 +0100 In-Reply-To: <20280352.post@talk.nabble.com> X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:105247 Archived-At: >>>>> On Sat, 1 Nov 2008, bwoster wrote: >> Any opinions about attached patch which adds a "--pidfile" option? > I'm all for it! I've just spent an hour trying to test out an init.d > script, but it is not very robust without a pidfile, so your patch > would make things so much easier... > Emacs does have the (emacs-pid) lisp function, but that too is not > easy to try, and there may be race conditions when two --daemons are > started. > Actually... with your patch, if two emacs --daemon > --pidfile=same_file are started, what will happen? The second one will win and overwrite the file. That's why you normally start daemons with a tool like "start-stop-daemon" which takes care of locking. Ulrich