Files
infix/patches/netsnmp/snmpd-reconf-ready.patch
T
Joachim Wiberg 0de25f9c19 patches/netsnmp: add pid readiness signaling for Finit
This patch adds PID readiness notification to Net-SNMP.  This is
required for synchronizing processes like subagents.

PID readiness is similar to systemd READY=1 notification, which
Finit supports, but Net-SNMP only supports that at first startup
not after SIGHUP.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-11-15 15:09:14 +01:00

30 lines
904 B
Diff

--- a/agent/snmpd.c 2023-11-10 08:51:59.539942616 +0100
+++ b/agent/snmpd.c 2023-11-10 08:56:27.719112830 +0100
@@ -179,6 +179,7 @@
#define TIMETICK 500000L
int snmp_dump_packet;
+static char *pid_file = NULL;
static int reconfig = 0;
int Facility = LOG_DAEMON;
@@ -397,7 +398,6 @@
int dont_fork = 0, do_help = 0;
int log_set = 0;
int agent_mode = -1;
- char *pid_file = NULL;
char option_compatability[] = "-Le";
#ifndef WIN32
int prepared_sockets = 0;
@@ -1174,6 +1174,10 @@
ret = sigprocmask(SIG_UNBLOCK, &set, NULL);
netsnmp_assert(ret == 0);
#endif
+ if (pid_file) {
+ /* Signal readiness after reconf (Finit) */
+ utimensat(0, pid_file, NULL, 0);
+ }
}
/*******************************************************************-o-******