Skip to content

Commit a7c44db

Browse files
authored
Merge pull request #1829 from jrha/metaconfig_chrony
ncm-metaconfig: Add chrony options for dealing with leap-second adjustments on time servers
2 parents 6cab1df + 602a965 commit a7c44db

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

ncm-metaconfig/src/main/metaconfig/chrony/main.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[% pair.value.join("\n") %]
99
[% CASE ['makestep'] -%]
1010
makestep [% pair.value.threshold %] [% pair.value.limit %]
11+
[% CASE ['smoothtime'] -%]
12+
smoothtime [% pair.value.max_freq %] [% pair.value.max_wander %] [% pair.value.leaponly ? 'leaponly' : '' %]
1113
[% CASE ['network'] -%]
1214
[% FOREACH entry IN pair.value -%]
1315
[% entry.action %] [% entry.host %]

ncm-metaconfig/src/main/metaconfig/chrony/pan/schema.pan

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ type chrony_service_network = {
6565
'host' : type_network_name
6666
};
6767

68+
@documentation{
69+
The smoothtime directive can be used to enable smoothing of the time that chronyd serves to its clients to make it
70+
easier for them to track it and keep their clocks close together even when large offset or frequency corrections
71+
are applied to the server’s clock, for example after being offline for a longer time.
72+
}
73+
type chrony_service_smoothtime = {
74+
@{ Maximum frequency offset of the smoothed time to the tracked NTP time (in ppm) }
75+
'max_freq' : double(0..100000)
76+
@{ Maximum rate at which the frequency offset is allowed to change (in ppm per second) }
77+
'max_wander' : double(0..100000)
78+
@{ Only smooth leap seconds, ignore normal offset and frequency changes }
79+
'leaponly' : boolean
80+
};
81+
6882
@documentation{
6983
the crony.conf configuration
7084
}
@@ -81,4 +95,10 @@ type chrony_service = {
8195
'keyfile' ? absolute_file_path
8296
'logdir' ? absolute_file_path
8397
'leapsectz' ? string
98+
@{ Select how errors caused by inerting leap seconds are corrected for }
99+
'leapsecmode' ? choice('system', 'step', 'slew', 'ignore')
100+
@{ Maximum rate at which chronyd is allowed to slew the time (in ppm), defaults to 83333.333 (i.e. 1000000/12)}
101+
'maxslewrate' ? double(0..100000)
102+
@{ Control smoothing of the time that chronyd serves to its clients }
103+
'smoothtime' ? chrony_service_smoothtime
84104
};

ncm-metaconfig/src/main/metaconfig/chrony/tests/profiles/config.pan

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ prefix '/software/components/metaconfig/services/{/etc/chrony.conf}/contents';
1919
'driftfile' = '/var/lib/chrony/drift';
2020
'keyfile' = '/etc/chrony.keys';
2121

22+
'leapsecmode' = 'slew';
23+
'maxslewrate' = 1000.0;
24+
'smoothtime/max_freq' = 400.0;
25+
'smoothtime/max_wander' = 0.001;
26+
'smoothtime/leaponly' = true;

ncm-metaconfig/src/main/metaconfig/chrony/tests/regexps/config/base

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ multiline
66
^driftfile /var/lib/chrony/drift$
77
^rtcsync$
88
^keyfile /etc/chrony.keys$
9+
^leapsecmode slew$
910
^makestep 0.1 3$
11+
^maxslewrate 1000$
1012
^allow 127.0.0.1$
1113
^deny 192.168.1.0/24$
1214
^pool pool.ntp.org\s+maxsources 6\s+iburst $
1315
^server ntp.date.org\s+iburst trust $
1416
^server ntp2.date.org $
17+
^smoothtime 400 0.001 leaponly$

0 commit comments

Comments
 (0)