help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running emacs deamon outside login


From: Richard Riley
Subject: Re: Running emacs deamon outside login
Date: Fri, 22 Jan 2010 04:45:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Steve Revilak <steve@srevilak.net> writes:

> --0lnxQi9hkpPO77W3
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Disposition: inline
>
>>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
>


Hi Steve.

I am confused as why any of this is necessary?

Th daemon doesn't need nohups. You dont need to run emacs --daemon and
you dont manually start the daemon if you dont want to (though "emacs
--daemon") will do just that. See my other post in this thread about my
EDITOR env.

The daemon already outlives any command shell that starts it - it ism
after all, a daemon.

regards

r.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]