Repository navigation
chrony: add UCI options for drift file and time restoration #30799
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,11 @@ config nts 'nts' | |
| option rtccheck '1' | ||
| option systemcerts '1' | ||
|
|
||
| config driftfile 'driftfile' | ||
| option restore_time '0' | ||
| option file '/var/run/chrony/drift' | ||
| # option interval '' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe The commented-out interval option could be setting it to 86400 as an example?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use file becouse chrony.conf manual page uses file in documentation Option name contains | Active entries | Commented examples | Total I just use such values to generate the same line as deleted in net/chrony/files/chrony.conf. Chronyd by default uses 3600 as interval value. If need to use some value I think need to use default if no any reasons to use specific value. |
||
|
|
||
| #config smoothtime 'smoothtime' | ||
| # option maxppm '400' | ||
| # option maxwander '0.01' | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this file needed? The service should start correctly even with a config that doesn't set driftfile, right?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Service will be started correctly. But in luci app section will be omitted. openwrt/luci#9139 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/sh | ||
|
|
||
| uci -q get chrony.driftfile >/dev/null && exit 0 | ||
|
|
||
| uci -q batch <<-EOF | ||
| set chrony.driftfile=driftfile | ||
| set chrony.driftfile.restore_time='0' | ||
| set chrony.driftfile.file='/var/run/chrony/drift' | ||
| commit chrony | ||
| EOF |
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.
/etc/chrony/chrony.confis a conffile, so if a user has modified it, the upgrade keeps their copy with thisdriftfileline. That line comes afterconfdir(line 2), so it overrides the UCI-generated directive and the newfile/intervaloptions are silently ignored. Is that acceptable, or should the upgrade path handle it (e.g. a note in the commit message, or a uci-defaults/sed migration)?Generated by Claude Code
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.
It's acceptable. User which modifies /etc/chrony/chrony.conf knows what he does. My patch just changes place of
driftfile /var/run/chrony/driftbut doesn't change behavior.