From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Re: Asynchronous shell command that leaves a background process running Date: Thu, 21 Oct 2010 12:24:36 -0700 Message-ID: References: <8762ww8b6g.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291886854 12423 80.91.229.12 (9 Dec 2010 09:27:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 09:27:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 10:27:31 2010 Return-path: Envelope-to: geh-help-gnu-emacs@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 1PQcmf-0003xK-6C for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 10:27:29 +0100 Original-Received: from localhost ([127.0.0.1]:42958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQcme-0007au-7B for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:27:28 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 21 Oct 2010 14:24:46 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:fM73sJrOHN6n4cq36gTONv9hZzM= Original-Lines: 23 Original-X-Trace: sv3-VNEbUSN5A+IiFuTi3gZwj/1J6o0Z/jP3tyZNq3Pthp6QUPxgH0Dg9lWvy5I8GEUiYW07VZtdyg5qIRV!IvYjt2c0gjJMM9Mtm+iagbEzGN7w9zT+QXKNUq1rRbh191TndXvGqtSKxWXQtcJj81+Pn70BbeOG!OFKplky4xooDiqu8wOWL7OOq Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2041 Original-Xref: usenet.stanford.edu gnu.emacs.help:181941 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76919 Archived-At: pjb@informatimago.com (Pascal J. Bourguignon) writes: > Sean McAfee writes: >> All is well when I run this command from an interactive shell, but >> things fall apart when I try to run it as an asynchronous shell command >> from Emacs, a la: >> >> (shell-command "wrapper-script arg1 arg2 &") >> [...] >> Is there a more elegant way to address this problem? > You can use: > > (shell-command "wrapper-script arg1 arg2 & disown") I tried variations on that, but couldn't find any way to run wrapper-script asynchronously, receiving its status messages in Emacs as it runs. > But really, the problem is with your real-program, which should be doing > the same as disown (setting a new process group, etc), since it exits > before its children. That's problematic, since real-program is a Java program.