Re: [chrony-users] Logging syslog messages to file |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] Logging syslog messages to file
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Mon, 17 Mar 2025 11:36:23 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742207799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kWFNbUgprnPqX6My636ZTDHe85kbpP9G1cCG1MSHSsI=; b=IbDrPkpMjjHXzG5wgIXPCZHMlpT6Xo2MizcbGhfZo7m3LrbXfcamqkmDUzcbcR5ghUz5fw wIi1/lcgUU4kIajpoqktufwlm1MnktIVVCKCzRaHiB3rIuGhxv7GZiQso4aHoTthnYUGt+ TU3QT56XkJ9vtrLWUIP8URxovLtI6zo=
On Fri, Mar 14, 2025 at 10:42:00AM +1300, Bryan Christianson wrote:
> I see I can use the '-l file' option of chronyd to log the messages to a file, but I have a few questions.
>
> 1. Does the location of 'file' use the LogDir directory by default?
No, logdir is only for the logs enabled by the log directive.
> If not, is there any problem in using that directory? My preferred location for the file would be in /var/log/chrony directory with a title of chronyd.log.
I think that's fine, except the directory already needs to exist as
the log is opened before chronyd checks/creates the logdir directory.
> 2. Can the log be rotated (i.e. closed then renamed) without restarting chronyd? This facility is available via chronyc for the measurement, tracking etc logs but I think that probably doesn't apply to syslog files. Would be really nice if it did.
The trouble with that is chronyd might no longer have the permissions
needed to do that. It opens the file very early when it still has root
permissions. Maybe it could try to open the file for the second time
and only if that succeeds, replace the original handle.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.