GNU bug report logs - #31521
[PATCH] * src/emacs.c (kill-emacs): notify systemd

Previous Next

Package: emacs;

Reported by: Lucas Werkmeister <mail <at> lucaswerkmeister.de>

Date: Fri, 18 May 2018 20:28:02 UTC

Severity: wishlist

Tags: fixed, patch

Merged with 31498

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lucas Werkmeister <mail <at> lucaswerkmeister.de>
To: 31521 <at> debbugs.gnu.org
Cc: Lucas Werkmeister <mail <at> lucaswerkmeister.de>
Subject: bug#31521: [PATCH] * src/emacs.c (kill-emacs): notify systemd
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





This bug report was last modified 7 years and 29 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.