INN commit: branches/2.6/innd (cc.c innd.c)
INN Commit
rra at isc.org
Fri Jan 15 22:35:45 UTC 2021
Date: Friday, January 15, 2021 @ 14:35:44
Author: iulius
Revision: 10514
innd: add systemd notifications for xexec and shutdown
Modified:
branches/2.6/innd/cc.c
branches/2.6/innd/innd.c
--------+
cc.c | 4 ++++
innd.c | 7 +++++++
2 files changed, 11 insertions(+)
Modified: cc.c
===================================================================
--- cc.c 2021-01-15 22:34:56 UTC (rev 10513)
+++ cc.c 2021-01-15 22:35:44 UTC (rev 10514)
@@ -1321,6 +1321,7 @@
char *innd;
char *p;
int i;
+ int status;
if (CCargv == NULL)
return "1 no argv!";
@@ -1341,6 +1342,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-15 22:34:56 UTC (rev 10513)
+++ innd.c 2021-01-15 22:35:44 UTC (rev 10514)
@@ -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