-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid spamming the log when /dev/rtc does not exist #2801
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Are you trying to use Raspberry Pi as a remote non-virtual machine guest with your PR #2000? |
It is a zero, so it doesn't have so many options. For the bigger Raspberry Pi, you can add* a battery RTC as well. * The Raspberry Pi 5 does feature a RTC by default, but then again the 4-5 (and 400) are more like a small ARM PC. |
For instance the Raspberry Pi does not have any real-time clock, so rely on network time synchronization instead (systemd-timesyncd). Signed-off-by: Anders F Björklund <[email protected]>
6a9c144
to
92ce4be
Compare
@@ -324,6 +324,11 @@ const deltaLimit = 2 * time.Second | |||
|
|||
func (a *agent) fixSystemTimeSkew() { | |||
for { | |||
ok, err := timesync.HasRTC() | |||
if !ok { | |||
logrus.Warnf("fixSystemTimeSkew: error: %s", err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use logrus.WithError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @afbjorklund
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add it, just didn't know if it was required (the other code is not using it yet)
For instance the Raspberry Pi does not have any real-time clock, so rely on network time synchronization instead (systemd-timesyncd).
Currently you get a warning every 10 seconds in the guestagent log
But it only needs to be logged once, that there is no
/dev/rtc
file.