diff options
author | Glenn Morris <rgm@gnu.org> | 2016-11-15 23:28:47 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2016-11-15 23:28:47 -0800 |
commit | 36b99556dea23f17d5598bbed366e7201eec9fbb (patch) | |
tree | b464455587a53e706288f95da497721c5c42a2c9 /etc | |
parent | 35007ad9daca9cac39fe758b5815aa6389379d38 (diff) | |
download | emacs-36b99556dea23f17d5598bbed366e7201eec9fbb.tar.gz |
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.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/NEWS | 6 | ||||
-rw-r--r-- | etc/emacs.service | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -64,6 +64,12 @@ affected by this, as SGI stopped supporting IRIX in December 2013. * Startup Changes in Emacs 26.1 +** New option '--new-daemon'. This is the same as '--daemon', except +it 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. '--old-daemon' is now an alias +for '--daemon'. + * Changes in Emacs 26.1 diff --git a/etc/emacs.service b/etc/emacs.service index 92cdeb5cf49..d9f7fc569d2 100644 --- a/etc/emacs.service +++ b/etc/emacs.service @@ -7,8 +7,8 @@ Description=Emacs text editor Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/ [Service] -Type=forking -ExecStart=emacs --daemon +Type=simple +ExecStart=emacs --new-daemon ExecStop=emacsclient --eval "(kill-emacs)" Environment=SSH_AUTH_SOCK=%t/keyring/ssh Restart=on-failure |