Add --new-daemon, which runs in the foreground and does not fork
commit36b99556dea23f17d5598bbed366e7201eec9fbb
authorGlenn Morris <rgm@gnu.org>
Wed, 16 Nov 2016 07:28:47 +0000 (15 23:28 -0800)
committerGlenn Morris <rgm@gnu.org>
Wed, 16 Nov 2016 07:28:47 +0000 (15 23:28 -0800)
treeb464455587a53e706288f95da497721c5c42a2c9
parent35007ad9daca9cac39fe758b5815aa6389379d38
Add --new-daemon, which runs in the foreground and does not fork

This is intended for modern init systems such as systemd,
which manage many of the traditional aspects of daemon behavior
themselves.  (Bug#2677)
* src/emacs.c (daemon_type): New integer.
(usage, standard_args): Add --old-daemon and --new-daemon.
(main): Handle --old-daemon and --new-daemon arguments.
Restrict all the forking and complicated daemon stuff to old-daemon.
(Fdaemon_initialized): Handle new-style daemon.
* src/lisp.h (IS_DAEMON, DAEMON_RUNNING) [!WINDOWNT]:
Replace daemon_pipe with daemon_type.
* doc/emacs/cmdargs.texi (Initial Options):
* doc/emacs/glossary.texi (Glossary):
* doc/emacs/misc.texi (Emacs Server):
* doc/lispref/display.texi (Window Systems):
* doc/lispref/os.texi (Startup Summary): Related doc updates.
* etc/NEWS: Mention this.
* etc/emacs.service: Use Type=simple and --new-daemon.
doc/emacs/cmdargs.texi
doc/emacs/glossary.texi
doc/emacs/misc.texi
doc/lispref/display.texi
doc/lispref/os.texi
etc/NEWS
etc/emacs.service
src/emacs.c
src/lisp.h