ignore maintenance signals on exit (#20190)
ingore maintenance signals on exit
Costa Tsaousis committed
Apr 28, 2025 at 11:12 UTC
0474d966540fa173781b8b6f46aadeaff3f6e420
1 file changed
+16
-8
src/daemon/signal-handler.c
+16
-8
@@ -227,17 +227,25 @@ static void process_triggered_signals(void) {
227
228
switch (signals_waiting[i].action) {
229
case NETDATA_SIGNAL_RELOAD_HEALTH:
230
- nd_log_limits_unlimited();
231
- netdata_log_info("SIGNAL: Received %s. Reloading HEALTH configuration...", name);
232
- nd_log_limits_reset();
233
- execute_command(CMD_RELOAD_HEALTH, NULL, NULL);
230
+ if(exit_initiated_get())
231
+ netdata_log_info("SIGNAL: Received %s. Ignoring it, as we are exiting...", name);
232
+ else {
233
+ nd_log_limits_unlimited();
234
+ netdata_log_info("SIGNAL: Received %s. Reloading HEALTH configuration...", name);
235
+ nd_log_limits_reset();
236
+ execute_command(CMD_RELOAD_HEALTH, NULL, NULL);
237
+ }
238
break;
239
240
case NETDATA_SIGNAL_REOPEN_LOGS:
237
- nd_log_limits_unlimited();
238
- netdata_log_info("SIGNAL: Received %s. Reopening all log files...", name);
239
- nd_log_limits_reset();
240
- execute_command(CMD_REOPEN_LOGS, NULL, NULL);
241
+ if(exit_initiated_get())
242
+ netdata_log_info("SIGNAL: Received %s. Ignoring it, as we are exiting...", name);
243
+ else {
244
+ nd_log_limits_unlimited();
245
+ netdata_log_info("SIGNAL: Received %s. Reopening all log files...", name);
246
+ nd_log_limits_reset();
247
+ execute_command(CMD_REOPEN_LOGS, NULL, NULL);
248
+ }
249
break;
250
251
case NETDATA_SIGNAL_EXIT_CLEANLY: