1. 26 Jul, 2018 1 commit
    • Lucas Werkmeister's avatar
      Notify systemd in daemon-initialized and kill-emacs (Bug#31498) · 19f5f7b1
      Lucas Werkmeister authored
      With --[bg-]daemon and Type=forking, systemd will only consider the
      daemon to have fully started up once the original process exits, and
      will wait until then to start units depending on the Emacs service.  To
      get the same functionality with --fg-daemon, use Type=notify instead of
      Type=simple and explicitly send a readiness notification to systemd at
      the point where the forked process would in --bg-daemon mode notify its
      parent process and cause it to exit.  Similarly, notify systemd at the
      beginning of the shutdown process as well.  (Both of these calls are
      successful no-ops if emacs was not started by systemd.)
      * etc/emacs.service: Update Type.
      * src/emacs.c (daemon-initialized) [HAVE_LIBSYSTEMD]:
      * src/emacs.c (kill-emacs) [HAVE_LIBSYSTEMD]: Call sd_notify().
  2. 30 May, 2017 1 commit
  3. 16 Nov, 2016 1 commit
    • Glenn Morris's avatar
      Add --new-daemon, which runs in the foreground and does not fork · 36b99556
      Glenn Morris authored
      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.
  4. 13 Nov, 2016 1 commit
    • Glenn Morris's avatar
      Include a systemd user unit file. (Bug#16507) · 181bd848
      Glenn Morris authored
      * etc/emacs.service: New file.
      * doc/emacs/misc.texi (Emacs Server): Mention systemcl --user.
      * Makefile.in (libdir): New, set by configure.
      (systemdunitdir): New variable.
      (install-etc, uninstall): Handle the emacs.service file.