Skip to content
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

Role fails on devices without realtime clock #9

Open
dschanoeh opened this issue Jul 6, 2020 · 2 comments
Open

Role fails on devices without realtime clock #9

dschanoeh opened this issue Jul 6, 2020 · 2 comments

Comments

@dschanoeh
Copy link

Hi,

I just ran this role against a pizero which doesn't have a RTC. In that case, the "Write adjtime" handler fails:

hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.

To fix, one could either:

  1. Add a variable "skip_rtc_update" or similar to skip the handler
  2. Try to detect if /dev/rtc exists and skip the handler if it doesn't
  3. Add a variable to specify the RTC device and a special value to skip RTC updates

I could create a PR for one of those options.

@dasJ
Copy link
Contributor

dasJ commented Jul 8, 2020

What about having something like timesync_rtc_set: true with a tri-state value of false (no update is attempted), true (an update is attempted if /dev/rtc exists), and force (role fails if /dev/rtc does not exist).

There is no reason why we wouldn't specify the RTC device, but I don't think (maybe I'm wrong) the path is different on different kernels.

@dschanoeh
Copy link
Author

The documentation indicates that it could also be /dev/rtc0, /dev/rtc1, etc. So maybe it wouldn't hurt to have a variable as well.
I'm almost done implementing the tri-state variable but having read more of the documentation, I'm now wondering:

  1. Doesn't timesyncd already automatically adjust the RTC? What's the purpose of that additional sync?
  2. But assuming that sync is useful, shouldn't it wait for the system time to actually be synchronized? I think that could take a few seconds... Status can be checked using timedatectl | grep "NTP synchronized". Should I add that as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants