From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to run --daemon in foreground? Date: Mon, 31 Oct 2016 15:41:31 +0300 Message-ID: <20161031124130.GA17965@protected.rcdrun.com> References: <20161029151559.GB30693@protected.rcdrun.com> <20161030153451214174078@bob.proulx.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1477917796 515 195.159.176.226 (31 Oct 2016 12:43:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 31 Oct 2016 12:43:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Stefan Monnier To: Glenn Morris Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 31 13:43:12 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1BvA-0003YZ-Mc for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Oct 2016 13:42:36 +0100 Original-Received: from localhost ([::1]:35357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1BvD-0002Co-9k for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Oct 2016 08:42:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1Bum-0002Ce-Tu for help-gnu-emacs@gnu.org; Mon, 31 Oct 2016 08:42:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1Bul-0003tp-TC for help-gnu-emacs@gnu.org; Mon, 31 Oct 2016 08:42:12 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:50745) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1Buh-0003tA-3o; Mon, 31 Oct 2016 08:42:07 -0400 Original-Received: from protected.rcdrun.com (localhost [::1]) (AUTH: PLAIN securesender, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by stw1.rcdrun.com with ESMTPSA; Mon, 31 Oct 2016 05:42:28 -0700 id 000000000004A077.0000000058173C35.000017BB Original-Received: from localhost (localhost [127.0.0.1]) (uid 1001) by protected.rcdrun.com with local; Mon, 31 Oct 2016 15:41:31 +0300 id 000000000002561F.0000000058173BFB.00004796 Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 217.170.207.13 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111643 Archived-At: Now I have found best solution for me to run emacs, by supervision of s6-rc tools http://skarnet.org/software/: #!/bin/execlineb if { s6-test -d /home/data1/protected/Work } su - admin -s /bin/execlineb -c "/usr/bin/screen -S emacs -D -m -- /usr/bin/emacs --user admin --chdir /home/data1/protected" The first line is only checking if directory exists, as it is only there with encrypted partition. Not in the standard one. The second one is taking all my user environment and starting screen with emacs. If emacs exists for any reason, screen does not have a shell to remain in background, but exists as well, due to execlineb program, and daemon is respawned. I still look into --start-server option, to heave it headless in background. Jean On Sun, Oct 30, 2016 at 08:19:26PM -0400, Glenn Morris wrote: > Stefan Monnier wrote: > > > Actually, it should be possible to use a foreground process without > > a tty by using "emacs --batch". IIUC it will require fiddling to make > > it work right, but it's be good if someone could try it and report its > > experience (e.g. in the form of a bug-report). > > There's a 7-year old bug report with a simple patch to add equivalent > functionality. https://debbugs.gnu.org/4944 > > It seems to me like a feature Emacs should have.