Skip to content

Commit a1d441f

Browse files
committed
In auditd, prevent plugin restarts by syncing stop to dispatcher immediately
Updated the SIGTERM handler in auditd to shut down the dispatcher before stopping the event loop
1 parent ddf47d6 commit a1d441f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add support for "exec" action in max_log_file_action in auditd
66
- Refactor auparse code to be multi-thread safe
77
- Add memory pool to netlink event processing to reduce memory churn
8+
- In auditd, prevern plugin restarts by syncing stop to dispatcher immediately
89

910
4.0.5
1011
- Rework audisp queue to be lockless

src/auditd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ static void usage(void)
127127

128128
/*
129129
* SIGTERM handler
130-
*/
130+
*/
131131
static void term_handler(struct ev_loop *loop, struct ev_signal *sig,
132132
int revents)
133133
{
134+
libdisp_shutdown();
134135
EV_STOP ();
135136
}
136137

@@ -1122,11 +1123,8 @@ int main(int argc, char *argv[])
11221123
ev_io_stop (loop, &pipe_watcher);
11231124
close_pipes();
11241125

1125-
// Give DAEMON_END event a little time to be sent in case
1126-
// of remote logging
1126+
// Give DAEMON_END event a little time
11271127
usleep(10000); // 10 milliseconds
1128-
libdisp_shutdown();
1129-
usleep(20000); // 20 milliseconds
11301128

11311129
// Tear down IO watchers Part 3
11321130
ev_signal_stop(loop, &sigchld_watcher);

0 commit comments

Comments
 (0)