Skip to content

Commit 2b7c23f

Browse files
committed
Fix misleading restart messages when plugin exceeds max_restarts
Fix UI issue where plugins would continue to show "was restarted" messages even after exceeding the maximum restart limit. Also, show how many times a plugin has been restarted. Here is how it looked like before: plugin /sbin/audisp-af_unix was restarted plugin /sbin/audisp-af_unix terminated unexpectedly plugin /sbin/audisp-af_unix was restarted --no such thing happened
1 parent 2c45093 commit 2b7c23f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

audisp/audispd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,12 @@ static int event_loop(void)
605605
audit_msg(LOG_ERR,
606606
"plugin %s has exceeded max_restarts",
607607
conf->p->path);
608-
}
609-
if (!AUDIT_ATOMIC_LOAD(stop) &&
610-
start_one_plugin(conf)) {
608+
} else if (!AUDIT_ATOMIC_LOAD(stop) && start_one_plugin(conf)) {
611609
rc = write_to_plugin(e, fmt_buf,
612610
len, conf);
613611
audit_msg(LOG_NOTICE,
614-
"plugin %s was restarted",
615-
conf->p->path);
612+
"plugin %s was restarted (%ux)",
613+
conf->p->path, conf->p->restart_cnt);
616614
conf->p->active = A_YES;
617615
}
618616
}

0 commit comments

Comments
 (0)