summaryrefslogtreecommitdiff
path: root/etc/emacs.service
diff options
context:
space:
mode:
authorLucas Werkmeister <mail@lucaswerkmeister.de>2018-06-09 15:01:08 +0200
committerNoam Postavsky <npostavs@gmail.com>2018-07-25 21:07:03 -0400
commit19f5f7b19b0dcdae87476a3fd51c41f840b2b80f (patch)
tree89706b7d4679fb70ca658ab474c469afef14333f /etc/emacs.service
parent244b6827257fb0ec9c14f19b9dd01a0e1bee1d75 (diff)
downloademacs-19f5f7b19b0dcdae87476a3fd51c41f840b2b80f.tar.gz
Notify systemd in daemon-initialized and kill-emacs (Bug#31498)
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().
Diffstat (limited to 'etc/emacs.service')
-rw-r--r--etc/emacs.service2
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/emacs.service b/etc/emacs.service
index b29177b120c..dbcb6bc301e 100644
--- a/etc/emacs.service
+++ b/etc/emacs.service
@@ -7,7 +7,7 @@ Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
-Type=simple
+Type=notify
ExecStart=emacs --fg-daemon
ExecStop=emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh