INN commit: trunk/innd (cc.c innd.c)

INN Commit rra at isc.org
Fri Jan 15 11:13:06 UTC 2021


    Date: Friday, January 15, 2021 @ 03:13:05
  Author: iulius
Revision: 10511

innd: add systemd notifications for xexec and shutdown

Modified:
  trunk/innd/cc.c
  trunk/innd/innd.c

--------+
 cc.c   |    4 ++++
 innd.c |    7 +++++++
 2 files changed, 11 insertions(+)

Modified: cc.c
===================================================================
--- cc.c	2021-01-11 22:06:59 UTC (rev 10510)
+++ cc.c	2021-01-15 11:13:05 UTC (rev 10511)
@@ -1329,6 +1329,7 @@
     char	*innd;
     char	*p;
     int		i;
+    int         status;
 
     if (CCargv == NULL)
 	return "1 no argv!";
@@ -1349,6 +1350,9 @@
 #endif
     JustCleanup();
     syslog(L_NOTICE, "%s execv %s", LogName, CCargv[0]);
+    status = sd_notify(false, "RELOADING=1");
+    if (status < 0)
+        warn("cannot notify systemd of reloading: %s", strerror(-status));
 
     /* Close all fds to protect possible fd leaking accross successive innds. */
     for (i=3; i<30; i++)

Modified: innd.c
===================================================================
--- innd.c	2021-01-11 22:06:59 UTC (rev 10510)
+++ innd.c	2021-01-15 11:13:05 UTC (rev 10511)
@@ -260,6 +260,12 @@
 void
 CleanupAndExit(int status, const char *why)
 {
+    int result;
+
+    result = sd_notify(false, "STOPPING=1");
+    if (result < 0)
+        warn("cannot notify systemd of stopping: %s", strerror(-result));
+
     JustCleanup();
     if (why)
         syslog(LOG_WARNING, "SERVER shutdown %s", why);
@@ -266,6 +272,7 @@
     else
         syslog(LOG_WARNING, "SERVER shutdown received signal %lu",
                (unsigned long) killer_signal);
+
     exit(status);
 }
 



More information about the inn-committers mailing list