all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Steve Revilak <steve@srevilak.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Running emacs deamon outside login
Date: Thu, 21 Jan 2010 22:04:46 -0500	[thread overview]
Message-ID: <20100122030446.GC411@srevilak.net> (raw)
In-Reply-To: <871vhjcvy9.wl%richard.lewis@gold.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

>From: Richard Lewis <richardlewis@fastmail.co.uk>
>Subject: Running emacs deamon outside login

>On Linux, I've been wondering whether there's a good way to run emacs
>deamon outside of my login process, so that I can log out and in again
>and connect to the same emacs deamon process.
>
>One sort of solution is running it using start-stop-deamon on Debian,
>essentially as described on emacswiki:
>
>http://www.emacswiki.org/emacs/EmacsAsDaemon#toc3
>
>However, to get this to work I've had to hack it as I describe at the
>bottom of that section (running emacs using su).
>
>This may be more of a Linux question than an Emacs question, but does
>anyone know of any better ways to do this? It's essentially just some
>way to ensure that the emacs process stays alive when I log out.

I hope you wont mind if I give more of a unix answer than an emacs
answer. :)

For the sake of simplicity, I'll assume that you want emacs to run
with your uid, and that you're content to start and kill the emacs
daemon on an as-need basis.  If you can live with these assumptions,
then here is a simple recipie

    nohup emacs --daemon </dev/null &

"nohup COMMAND" runs COMMAND, but arranges for sighup to be ignored.
This allows COMMAND to outlive the shell that started it.

Redirecting stdin from /dev/null will prevent your shell from hanging
when the shell exits.

This invocation should create a $HOME/nohup.out; nohup redirects
stdout and stderr to that file.  If you don't want nohup.out, you can
redirect stdout and stderr yourself, like this

    nohup emacs --daemon </dev/null >/dev/null 2>&1  &

Finally, these command lines use bash syntax.  If you're using a
different shell, then you might have to adjust them slightly.

Steve



[-- Attachment #2: Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2010-01-22  3:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100121164606.CDCD410AFB7@mxperim6.sea5.speakeasy.net>
2010-01-21 15:35 ` Running emacs deamon outside login Richard Lewis
2010-01-21 18:21   ` Suvayu Ali
2010-01-21 20:37   ` Richard Riley
     [not found]   ` <mailman.1886.1264098077.18930.help-gnu-emacs@gnu.org>
2010-01-21 22:04     ` Richard Lewis
2010-01-22  3:04   ` Steve Revilak [this message]
2010-01-22  3:45     ` Richard Riley
2010-01-23 19:38       ` Steve Revilak
2010-01-23 19:59         ` Richard Riley
2010-01-24  6:53         ` tomas
2010-01-24 14:09           ` Steve Revilak
2010-01-25  5:32             ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100122030446.GC411@srevilak.net \
    --to=steve@srevilak.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.