Commit 569f3aa
MB-28651: Ensure audit.log exists as much as possible
The changes documented below are to ensure that the audit.log file
almost always exists and open available for writing.
Note: It is not possible for the file to always exist because when
we rotate the file we close the current one, rename and open the new
one.
The changes are as follows:
Create the audit.log file immediately after a file rotation occurs (as
opposed to when a new audit event is recieved).
If the log file is due to rotate, but it is currently empty,
instead of closing the file, keep it open and update the open_time
so that the next rotation will occur at the correct time.
If there is a failure writing to disk, which causes us to close (and
possibly rotate) the audit file, make sure that the file exists and is
re-opened immediately afterwards.
Change-Id: Ib93abf1d45eb36c15b6f2dee438f9956894fff58
Reviewed-on: http://review.couchbase.org/90599
Reviewed-by: Trond Norbye <[email protected]>
Tested-by: Build Bot <[email protected]>1 parent e0ccc57 commit 569f3aa
File tree
5 files changed
+29
-2
lines changed- auditd/src
5 files changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
412 | 417 | | |
413 | 418 | | |
414 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
0 commit comments