Comments on EmacsAsDaemon


Hi, a suggestion for this page. Start with the big picture – why would one want to run emacs in a daemon? I landed on this page first in google trying to answer that question, and couldn’t find it here. I suggest putting an intro with something along the lines of:

http://devblog.avdi.org/2011/10/27/running-emacs-as-a-server-emacs-reboot-15/

Shawn shawn (at) weirdness (dot) com

– realscrappy 2014-05-12 18:58 UTC


“After that, using emacsclient (or emacsclient -t) will automatically start an emacs in daemon mode and connect to it if one is not found running, and sane programs will know to run emacsclient to start an editor.”

This point is debatable, and so makes the “Simple setup” misleading:

If the emacs daemon isn’t started, either by `emacs --daemon`, or by `M-x server-start` in emacs, then plenty of sane programs – for instance, most bash shells – will not start an editor. They will output, `emacsclient: can’t find socket; have you started the server?`.

– joseph8th 2016-01-19 03:43 UTC


In the section Starting Emacs Daemon with systemd/CentOS, with

ExecStart=/usr/bin/emacs --daemon --user %u
...
User=%i

I get emacs running as emacs --daemon --user root. If I replace ExecStart=/usr/bin/emacs --daemon --user %u with ExecStart=/usr/bin/emacs --daemon --user %i then I get emacs --daemon --user arch as desired. Is it a typo on the wiki page or an issue with my configuration?

ArchStanton 2019-06-06 14:50 UTC


https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers says

"%i"	Instance name	For instantiated units this is the string between the first "@" character and the type suffix. Empty for non-instantiated units.
"%u"	User name	This is the name of the user running the service manager instance. In case of the system manager this resolves to "root".

So I’m guessing --user %i is the right thing.

– npostavs 2019-06-07 11:54 UTC


Please make sure you contribute only your own work. IP numbers are made available via the page history. If you want to keep it a secret, you need to use Tor. See TextFormattingRules for how to format text. See StyleGuide for the suggested writing style on this wiki.

To save this page you must answer this question:

What is the greatest editor out there?