From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: trying to fork away from Emacs in a sub-process from elisp Date: Tue, 09 Aug 2005 21:57:52 +0100 Message-ID: <874q9yg75b.fsf@kanga.tapsellferrier.co.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1123621756 4620 80.91.229.2 (9 Aug 2005 21:09:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Aug 2005 21:09:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 09 23:09:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E2bJz-0008B4-4y for ged-emacs-devel@m.gmane.org; Tue, 09 Aug 2005 23:07:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2bN4-0000u3-27 for ged-emacs-devel@m.gmane.org; Tue, 09 Aug 2005 17:10:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2bL0-0000Rd-F8 for emacs-devel@gnu.org; Tue, 09 Aug 2005 17:08:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2bKs-0000Nq-1r for emacs-devel@gnu.org; Tue, 09 Aug 2005 17:08:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2bKr-0000NN-Si for emacs-devel@gnu.org; Tue, 09 Aug 2005 17:08:33 -0400 Original-Received: from [80.168.156.78] (helo=owls-tree.tapsellferrier.co.uk) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1E2bUh-0005uD-Mz for emacs-devel@gnu.org; Tue, 09 Aug 2005 17:18:43 -0400 Original-Received: from [172.31.50.1] (helo=kanga) by owls-tree.tapsellferrier.co.uk with esmtp (Exim 4.50 #1 (Debian)) id 1E2b9k-0000WY-EC; Tue, 09 Aug 2005 21:57:04 +0100 Original-Received: from nferrier by kanga with local (Exim 4.50) id 1E2bAW-0000st-Jq; Tue, 09 Aug 2005 21:57:52 +0100 Original-To: emacs-devel@gnu.org 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:41813 I'm writing a tiny image viewer to be used in conjunction with emacs. I've constructed the viewer so that it need only start once. It sets up a named pipe so that all subsequent invocations talk to the initial program over the named pipe (imagemagick is supposed to do this with the -remote option, but it doesn't work). I realize that I *could* implement the when-is-the-process-the-first-process logic in elisp... but I thought it was simpler and neater to have the client program simply daemonize itself on the fifo setup invocation. Trouble is, when the program daemonizes, Emacs doesn't seem to recognize it and carries on waiting (waiting for what I'm not sure). Is there some reason why client programs cannot daemonize when started by emacs? For reference, my client program is written in python and is following this basic procedure: fork child: setsid fork child: chdir / close stdout close stdin close stderr Nic Ferrier