mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-07 05:15:06 -05:00
logging: try to reopen message log on cyclelogs command
When the cyclelogs command is issued, check if the file specified by the -l option is still in its place and if not try opening it again. If that fails (e.g. due to chrony no longer having root privileges), keep the old file handle to avoid losing log messages.
This commit is contained in:
@@ -1467,6 +1467,13 @@ purged. An example of how to do this is shown below.
|
||||
# chronyc cyclelogs
|
||||
# rm /var/log/chrony/measurements1.log
|
||||
----
|
||||
+
|
||||
Note that log files enabled by the *log* directive are opened when the first
|
||||
entry is made. The message log file specified by the *chronyd*'s *-l* option is
|
||||
opened early on start and closed on the *cyclelogs* command only if opening of
|
||||
the new file succeeds to avoid losing messages. If *chronyd* is configured to
|
||||
drop root privileges and the directory containg the log file is not writable
|
||||
for the specified user, *chronyd* will not be able to open the file again.
|
||||
|
||||
[[dump]]*dump*::
|
||||
The *dump* command causes *chronyd* to write its current history of
|
||||
|
||||
Reference in New Issue
Block a user