aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorGlenn Morris2016-11-15 23:28:47 -0800
committerGlenn Morris2016-11-15 23:28:47 -0800
commit36b99556dea23f17d5598bbed366e7201eec9fbb (patch)
treeb464455587a53e706288f95da497721c5c42a2c9 /src/lisp.h
parent35007ad9daca9cac39fe758b5815aa6389379d38 (diff)
downloademacs-36b99556dea23f17d5598bbed366e7201eec9fbb.tar.gz
emacs-36b99556dea23f17d5598bbed366e7201eec9fbb.zip
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 'src/lisp.h')
-rw-r--r--src/lisp.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lisp.h b/src/lisp.h
index aaa44232720..e087828d94f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4139,12 +4139,11 @@ extern bool no_site_lisp;
4139/* True means put details like time stamps into builds. */ 4139/* True means put details like time stamps into builds. */
4140extern bool build_details; 4140extern bool build_details;
4141 4141
4142/* Pipe used to send exit notification to the daemon parent at
4143 startup. On Windows, we use a kernel event instead. */
4144#ifndef WINDOWSNT 4142#ifndef WINDOWSNT
4145extern int daemon_pipe[2]; 4143/* 0 not a daemon, 1 new-style (foreground), 2 old-style (background). */
4146#define IS_DAEMON (daemon_pipe[1] != 0) 4144extern int daemon_type;
4147#define DAEMON_RUNNING (daemon_pipe[1] >= 0) 4145#define IS_DAEMON (daemon_type != 0)
4146#define DAEMON_RUNNING (daemon_type >= 0)
4148#else /* WINDOWSNT */ 4147#else /* WINDOWSNT */
4149extern void *w32_daemon_event; 4148extern void *w32_daemon_event;
4150#define IS_DAEMON (w32_daemon_event != NULL) 4149#define IS_DAEMON (w32_daemon_event != NULL)