Subject: [PATCH] * src/emacs.c (kill-emacs): notify systemd

From: Lucas Werkmeister <[email-masked]>
Date: Fri, 18 May 2018 22:27:27 +0200

---

Notes:
    This doesn’t do very much beyond changing what you see in `systemctl
    status`, but I figure it doesn’t hurt either. (But feel free to
    reject the patch if you disagree, I won’t mind.)

 src/emacs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/emacs.c b/src/emacs.c
index f25e612664..d204dadb79 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2017,6 +2017,10 @@ all of which are called before Emacs is actually killed.  */
 {
   int exit_code;
 
+#ifdef HAVE_LIBSYSTEMD
+  sd_notify(0, "STOPPING=1");
+#endif /* HAVE_LIBSYSTEMD */
+
   /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
      set.  */
   waiting_for_input = 0;
-- 
2.17.0