File: chrony.html

package info (click to toggle)
chrony 1.21z-5
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 2,080 kB
  • ctags: 2,375
  • sloc: ansic: 14,831; yacc: 858; sh: 588; perl: 426; makefile: 148
file content (4672 lines) | stat: -rw-r--r-- 216,624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
<html lang="en">
<head>
<title>User guide for the chrony suite</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="User guide for the chrony suite">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc { font-variant:small-caps }
  span.roman { font-family: serif; font-weight: normal; } 
--></style>
</head>
<body>
<h1 class="settitle">User guide for the chrony suite</h1>
<div class="node">
<p><hr>
<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>

<h2 class="unnumbered">User guide for the chrony suite</h2>

<ul class="menu">
<li><a accesskey="1" href="#Introduction">Introduction</a>:                 What the chrony suite does
<li><a accesskey="2" href="#Installation">Installation</a>:                 How to compile and install the software
<li><a accesskey="3" href="#Typical-scenarios">Typical scenarios</a>:            How to configure the software for some common cases
<li><a accesskey="4" href="#Usage-reference">Usage reference</a>:              Reference manual
<li><a accesskey="5" href="#Porting-guide">Porting guide</a>:                Hints to help with porting the software
<li><a accesskey="6" href="#GPL">GPL</a>:                          The GNU General Public License
</ul>
<!-- }}} -->
<!-- {{{ Ch:Introduction -->
<!-- {{{ Chapter top -->
<div class="node">
<p><hr>
<a name="Introduction"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Installation">Installation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">1 Introduction</h2>

<ul class="menu">
<li><a accesskey="1" href="#Overview">Overview</a>:                     What the programs do
<li><a accesskey="2" href="#Acknowledgements">Acknowledgements</a>:             Credit where credit is due
<li><a accesskey="3" href="#Availability">Availability</a>:                 Where to get the software
<li><a accesskey="4" href="#Other-time-synchronisation-packages">Other time synchronisation packages</a>:   Comparision with other software
<li><a accesskey="5" href="#Distribution-and-warranty">Distribution and warranty</a>:    There is no warranty
<li><a accesskey="6" href="#Bug-reporting">Bug reporting</a>:                How to report bugs and make suggestions
<li><a accesskey="7" href="#Contributing">Contributing</a>:                 Areas where contributions are particularly welcome
</ul>
<!-- }}} -->
<!-- {{{ S:Overview -->
<div class="node">
<p><hr>
<a name="Overview"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Acknowledgements">Acknowledgements</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.1 Overview</h3>

<p>Chrony is a software package for maintaining the accuracy of computer
system clocks.  It consists of a pair of programs :

     <ul>
<li><code>chronyd</code>.  This is a daemon which runs in background on the
system.  It obtains measurements (e.g. via the network) of the system's
offset relative to other systems, and adjusts the system time
accordingly.  For isolated systems, the user can periodically enter the
correct time by hand (using <code>chronyc</code>).  In either case,
<code>chronyd</code> determines the rate at which the computer gains or loses
time, and compensates for this.

     <p><code>chronyd</code> can also act as an NTP server, and provide a time-of-day service
to other computers.  A typical set-up is to run <code>chronyd</code> on a gateway
computer that has a dial-up link to the Internet, and use it to serve time to
computers on a private LAN sitting behind the gateway.  The IP addresses that
can act as clients of <code>chronyd</code> can be tightly controlled.  The default is
no client access.

     <li><code>chronyc</code>.  This is a command-line driven control and
monitoring program.  An administrator can use this to fine-tune various
parameters within the daemon, add or delete servers etc whilst the
daemon is running.

     <p>The IP addresses from which <code>chronyc</code> clients may connect can be tightly
controlled.  The default is just the computer that <code>chronyd</code> itself is
running on. 
</ul>
   <!-- }}} -->
<!-- {{{ S:Acknowledgments -->
<div class="node">
<p><hr>
<a name="Acknowledgements"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Availability">Availability</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Overview">Overview</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.2 Acknowledgements</h3>

<p>The <code>chrony</code> suite makes use of the algorithm known as <em>RSA
Data Security, Inc. MD5 Message-Digest Algorithm</em> for authenticating
messages between different machines on the network.

   <p>In writing the <code>chronyd</code> program, extensive use has been made of
RFC1305, written by David Mills.  I have occasionally referred to the
<code>xntp</code> suite's source code to check details of the protocol that
the RFC did not make absolutely clear.  The core algorithms in
<code>chronyd</code> are all completely distinct from <code>xntp</code>, however. 
<!-- }}} -->
<!-- {{{ S:Availability -->
<div class="node">
<p><hr>
<a name="Availability"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Other-time-synchronisation-packages">Other time synchronisation packages</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Acknowledgements">Acknowledgements</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.3 Availability</h3>

<ul class="menu">
<li><a accesskey="1" href="#Getting-the-software">Getting the software</a>:         Where can I get the software from? 
<li><a accesskey="2" href="#Platforms">Platforms</a>:                    Which platforms will it run on? 
</ul>

<div class="node">
<p><hr>
<a name="Getting-the-software"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Platforms">Platforms</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Availability">Availability</a>
<br>
</div>

<h4 class="subsection">1.3.1 Getting the software</h4>

<p>Links on <a href="http://chrony.sunsite.dk/download.php">the chrony home page</a> describe how to obtain the software.

<div class="node">
<p><hr>
<a name="Platforms"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Getting-the-software">Getting the software</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Availability">Availability</a>
<br>
</div>

<h4 class="subsection">1.3.2 Platforms</h4>

<p>Although most of the program is portable between
Unix-like systems, there are parts that have to be tailored to each
specific vendor's system.  These are the parts that interface with the
operating system's facilities for adjusting the system clock;
different operating systems may provide different function calls to
achieve this, and even where the same function is used it may have
different quirks in its behaviour.

   <p>The software is known to work in the following environments:
     <ul>
<li>Linux/i386 and Linux/ppc.  The software is known to work on Linux 2.0.x,
2.2.x and 2.4.x.  Prior to 2.0.31, the real time clock can't be used.

     <li>NetBSD
<li>BSD/386

     <li>Solaris 2.3/2.5/2.5.1/2.6/2.7/2.8 on Sparc (Sparc 20, Ultrasparc) and
i386

     <li>SunOS 4.1.4 on Sparc 2 and Sparc20. 
</ul>

   <p>Closely related systems may work too, but they have not been tested.

   <p>Porting the software to other system (particularly to those supporting
an <code>adjtime</code> system call) should not be difficult, however it
requires access to such systems to test out the driver. 
<!-- }}} -->
<!-- {{{ S:Other programs -->
<div class="node">
<p><hr>
<a name="Other-time-synchronisation-packages"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Distribution-and-warranty">Distribution and warranty</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Availability">Availability</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.4 Relationship to other software packages</h3>

<ul class="menu">
<li><a accesskey="1" href="#Comparison-with-xntpd">Comparison with xntpd</a>
<li><a accesskey="2" href="#Comparison-with-timed">Comparison with timed</a>
</ul>

<div class="node">
<p><hr>
<a name="Comparison-with-xntpd"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Comparison-with-timed">Comparison with timed</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Other-time-synchronisation-packages">Other time synchronisation packages</a>
<br>
</div>

<h4 class="subsection">1.4.1 xntpd</h4>

<p>The `reference' implementation of the Network Time Protocol is the
program <code>xntpd</code>, available via
<a href="http://www.eecis.udel.edu/~ntp">The NTP home page</a>.

   <p><code>xntpd</code> is designed to support all the operating modes defined by
RFC1305, and has driver support for a large number of reference clocks
(such as GPS receivers) that can be connected directly to a computer,
thereby providing a so-called 'stratum 1' server.

   <p>Things <code>chronyd</code> can do that <code>xntpd</code> can't:

     <ul>
<li><code>chronyd</code> can perform usefully in an environment where access to
the time reference is intermittent.  <code>chronyd</code> estimates
<em>both</em> the current time offset <em>and</em> the rate at which the
computer's clock gains or loses time, and can use that rate estimate to
trim the clock after the reference disappears.  <code>xntpd</code> corrects
any time offset by speeding up and slowing down the computer clock, and
so could be left with a significant rate error if the reference
disappears whilst it is trying to correct a big offset.

     <li><code>chronyd</code> provides support for isolated networks whether the only
method of time correction is manual entry (e.g. by the administrator
looking at a clock).  <code>chronyd</code> can look at the errors corrected at
different updates to work out the rate at which the computer gains or
loses time, and use this estimate to trim the computer clock
subsequently.

     <li><code>chronyd</code> provides support to work out the gain or loss rate of the
`real-time clock', i.e. the clock that maintains the time when the
computer is turned off.  It can use this data when the system boots to
set the system time from a corrected version of the real-time clock. 
These real-time clock facilities are only available on certain releases
of Linux, so far.

     <li>The <code>xntpd</code> program is supported by other programs to carry out
certain functions.  <code>ntpdate</code> is used to provide an initial
correction to the system clock based on a `one-shot' sampling of other
NTP servers.  <code>tickadj</code> is used to adjust certain operating system
parameters to make <code>xntpd</code> work better.  All this functionality is
integrated into <code>chronyd</code>. 
</ul>

   <p>Things <code>xntpd</code> can do that <code>chronyd</code> can't:

     <ul>
<li><code>xntpd</code> supports a range of different hardware reference clocks
(GPS, atomic etc) that can be connected to a computer to provide a
`stratum-1' server.  <code>chronyd</code> does not support any such hardware
<em>yet</em>; I don't have access to any to do any development work. 
However, the software architecture should allow such equipment to be
interfaced at a later date.

     <li><code>xntpd</code> supports effectively all of RFC1305, including broadcast /
multicast clients, leap seconds, and extra encryption schemes for
authenticating data packets.

     <li><code>xntpd</code> has been ported to more types of computer / operating
system (so far).

     <li>xntpd is designed to work solely with integer arithmetic (i.e. does not
require floating point support from its host). 
</ul>

<div class="node">
<p><hr>
<a name="Comparison-with-timed"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Comparison-with-xntpd">Comparison with xntpd</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Other-time-synchronisation-packages">Other time synchronisation packages</a>
<br>
</div>

<h4 class="subsection">1.4.2 timed</h4>

<p><code>timed</code> is a program that is part of the BSD networking suite.  It
uses broadcast packets to find all machines running the daemon within a
subnet.  The machines elect a master which periodically measures the
system clock offsets of the other computers using ICMP timestamps. 
Corrections are sent to each member as a result of this process.

   <p>Problems that may arise with <code>timed</code> are :

     <ul>
<li>Because it uses broadcasts, it is not possible to isolate its
functionality to a particular group of computers; there is a risk of
upsetting other computers on the same network (e.g. where a whole
company is on the same subnet but different departments are independent
from the point of view of administering their computers.) 
<li>The update period appears to be 10 minutes.  Computers can build up
significant offsets relative to each other in that time.  If a
computer can estimate its rate of drift it can keep itself closer to
the other computers between updates by adjusting its clock every few
seconds.  <code>timed</code> does not seem to do this. 
<li><code>timed</code> does not have any integrated capability for feeding
real-time into its estimates, or for estimating the average rate of time
loss/gain of the machines relative to real-time (unless one of the
computers in the group has access to an external reference and is always
appointed as the `master'). 
</ul>

   <p><code>timed</code> does have the benefit over <code>chronyd</code> that for isolated
networks of computers, they will track the `majority vote' time.  For
such isolated networks, <code>chronyd</code> requires one computer to be the
`master' with the others slaved to it.  If the master has a particular
defective clock, the whole set of computers will tend to slip relative
to real time (but they <em>will</em> stay accurate relative to one
another). 
<!-- }}} -->
<!-- {{{ S:Rights + warranty -->
<div class="node">
<p><hr>
<a name="Distribution-and-warranty"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Bug-reporting">Bug reporting</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Other-time-synchronisation-packages">Other time synchronisation packages</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.5 Distribution rights and (lack of) warranty</h3>

<p>Chrony may be distributed in accordance with the GNU General Public License
version 2, reproduced in See <a href="#GPL">GPL</a>.

<!-- }}} -->
<!-- {{{ S:Bug reporting + suggestions -->
<div class="node">
<p><hr>
<a name="Bug-reporting"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Contributing">Contributing</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Distribution-and-warranty">Distribution and warranty</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.6 Bug reporting and suggestions</h3>

<p>If you think you've found a bug in chrony, or have a suggestion, please let me
know.  My primary current email address is <a href="mailto:rc@rc0.org.uk">rc@rc0.org.uk</a>.  If that
fails, you could try finding me through one of the chrony mailing lists, or by
looking up my name on a search engine.

   <p>I can't promise a timescale to fix a bug; it depends a lot on the how complex
the bug is to track down, as I have a lot of other calls on my time : 2 young
children, my job, and indeed other free/open source software projects. 
However, I do intend to look into problems when time allows.

   <p>Another source of information to try is the chrony users mailing list.  You can
join this by sending an empty message to
<a href="mailto:chrony-users-subscribe@sunsite.dk">chrony-users-subscribe@sunsite.dk</a>.  Only subscribers can post to
the list.

   <p>When you are reporting a bug, please send me all the information you can. 
Unfortunately, chrony has proven to be one of those programs where it is very
difficult to reproduce bugs in a different environment.  So I may have to
interact with you quite a lot to obtain enough extra logging and tracing to
pin-point the problem in some cases.  Please be patient and plan for this!

   <p>Of course, if you can debug the problem yourself and send me a source code
patch to fix it, I will be very grateful!

<!-- }}} -->
<!-- {{{ S:Contributions -->
<div class="node">
<p><hr>
<a name="Contributing"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Bug-reporting">Bug reporting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.7 Contributions</h3>

<p>Although chrony is now a fairly mature and established project, there are still
areas that could be improved.  If you can program in C and have some expertise
in these areas, you might be able to fill the gaps.

   <p>Particular areas I know need addressing are :

     <ol type=1 start=1>
<li>Porting to other Unices

     <p>This involves creating equivalents of sys_solaris.c, sys_linux.c etc for the
new system.  Note, the Linux driver has been reported as working on a range of
different architectures (Alpha, Sparc, MIPS as well as x86 of course).

     <li>Porting to Windows NT

     <p>I did a small amount of work on this under Cygwin.  Only the sorting out of the
include files has really been achieved so far.  The two main areas still to
address are

          <ol type=1 start=1>
<li>The system clock driver. 
<li>How to make chronyd into an NT service (i.e. what to replace fork(),
setsid() etc with so that chronyd can be automatically started in the system
bootstrap.
          </ol>

     <li>Hardware clock support

     <li>Automation of the trimrtc and writertc mechanisms

     <p>Currently, the RTC trimming mechanism is a manual operation, because there has
to be a reasonable guarantee that the system will stay up for a reasonable
length of time afterwards.  (If it is shut down too soon, a poor
characterisation of the RTC drift rate will be stored on disc, giving a bad
system clock error when the system is next booted.)

     <p>To make chrony more automated for the non-expert user, it would be useful if
this problem could be avoided so that trimrtc could be done automatically (e.g. 
in a crontab, or as part of the ip-up or ip-down scripts.)

        </ol>
<!-- }}} -->
<!-- }}} -->
<!-- {{{ Ch:Installation -->
<div class="node">
<p><hr>
<a name="Installation"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Typical-scenarios">Typical scenarios</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">2 Installation</h2>

<!-- {{{ main introduction text -->
<p>The software is distributed as source code which has to be compiled. 
The source code is supplied in the form of a gzipped tar file, which
unpacks to a subdirectory identifying the name and version of the
program.

   <p>After unpacking the source code, change directory into it, and type

<pre class="example">     ./configure
</pre>
   <p>This is a shell script that automatically determines the system type. 
There is a single optional parameter, <code>--prefix</code> which indicates
the directory tree where the software should be installed.  For example,

<pre class="example">     ./configure --prefix=/opt/free
</pre>
   <p>will install the <code>chronyd</code> daemon into /opt/free/sbin and the
chronyc control program into /opt/free/bin.  The default value for the
prefix is /usr/local.

   <p>The configure script assumes you want to use gcc as your compiler. 
If you want to use a different compiler, you can configure this way:

<pre class="example">     CC=cc CFLAGS=-O ./configure --prefix=/opt/free
</pre>
   <p>for Bourne-family shells, or

<pre class="example">     setenv CC cc
     setenv CFLAGS -O
     ./configure --prefix=/opt/free
</pre>
   <p>for C-family shells.

   <p>If the software cannot (yet) be built on your system, an error message
will be shown.  Otherwise, the files <span class="file">options.h</span> and
<span class="file">Makefile</span> will be generated.

   <p>By default, chronyc will be built to make use of the readline library.  If you
don't want this, specify the &ndash;disable-readline flag to configure.  If you have
readline and/or ncurses installed in a non-standard location, please refer to
see <a href="#readline-support">readline support</a> for information.

   <p>Now type

<pre class="example">     make
</pre>
   <p>to build the programs.

   <p>If you want to build the manual in plain text, HTML and info versions, type

<pre class="example">     make docs
</pre>
   <p>Once the programs have been successfully compiled, they need to be
installed in their target locations.  This step normally needs to be
performed by the superuser, and requires the following command to be
entered.

<pre class="example">     make install
</pre>
   <p>This will install the binaries, plain text manual and manpages.

   <p>To install the HTML and info versions of the manual as well, enter the command

<pre class="example">     make install-docs
</pre>
   <p>If you want chrony to appear in the top level info directory listing, you need
to run the <span class="command">install-info</span> command manually after this step. 
<span class="command">install-info</span> takes 2 arguments.  The first is the path to the
<span class="file">chrony.info</span> file you have just installed.  This will be the argument you
gave to &ndash;prefix when you configured (<span class="file">/usr/local</span> by default), with
<span class="file">/info/chrony.info</span> on the end.  The second argument is the location of
the file called <span class="file">dir</span>.  This will typically be <span class="file">/usr/info/dir</span>.  So
the typical command line would be

<pre class="example">     install-info /usr/local/info/chrony.info /usr/info/dir
</pre>
   <p>Now that the software is successfully installed, the next step is to
set up a configuration file.  The contents of this depend on the
network environment in which the computer operates.  The Debian
package installs a simple configuration file suitable for a dial-up
pc.  You should edit it to suit your situation.  Typical scenarios are
described in the following section of the document. 
<!-- }}} -->

<ul class="menu">
<li><a accesskey="1" href="#readline-support">readline support</a>:             If readline or ncurses in in a non-standard place
<li><a accesskey="2" href="#package-builders">package builders</a>:             Extra options useful to package builders
</ul>
<!-- {{{ readline support -->
<div class="node">
<p><hr>
<a name="readline-support"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#package-builders">package builders</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
<br>
</div>

<h3 class="section">2.1 Support for the readline library</h3>

<p>By default, chronyc is built to make use of the readline library.  This allows
you to use the cursor keys to replay and edit old commands.  If you don't want
to use readline (in which case chronyc will use a minimal command line
interface), invoke configure like this:

<pre class="example">     ./configure --disable-readline other-options...
</pre>
   <p>If you have readline and/or ncurses installed in locations that aren't normally searched by the compiler and linker, you need extra options if you want readline to be used:

     <dl>
<dt><span class="samp">--with-readline-includes=directory_name</span><dd>This defines the name of the directory above the one where <span class="file">readline.h</span>
is.  <span class="file">readline.h</span> is assumed to be in a <span class="file">readline</span> subdirectory of
the named directory.

     <br><dt><span class="samp">--with-readline-library=directory_name</span><dd>This defines the directory containing the <span class="file">libreadline.a</span> or
<span class="file">libreadline.so</span> file.

     <br><dt><span class="samp">--with-ncurses-library=directory_name</span><dd>This defines the directory containing the <span class="file">libncurses.a</span> or
<span class="file">libncurses.so</span> file. 
</dl>

<!-- }}} -->
<!-- {{{ -->
<div class="node">
<p><hr>
<a name="package-builders"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#readline-support">readline support</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
<br>
</div>

<h3 class="section">2.2 Extra options for package builders</h3>

<p>The configure and make procedures have some extra options that may be useful if
you are building a distribution package for chrony.

   <p>The &ndash;infodir=DIR option to configure specifies a different install directory
for the info files.  This overrides the <span class="file">info</span> subdirectory of the
argument to the &ndash;prefix option.  For example, you might use

<pre class="example">     ./configure --prefix=/usr --infodir=/usr/share/info
</pre>
   <p>The &ndash;mandir=DIR option to configure specifies a different install directory
for the man pages.  This overrides the <span class="file">man</span> subdirectory of the
argument to the &ndash;prefix option.

<pre class="example">     ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man
</pre>
   <p>to set both options together.

   <p>The final option is the DESTDIR option to the make command.  For example, you
could use the commands

<pre class="example">     ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man
     make all docs
     make install DESTDIR=./tmp
     cd tmp
     tar cvf - . | gzip -9 &gt; chrony.tar.gz
</pre>
   <p>to build a package.  When untarred within the root directory, this will install
the files to the intended final locations.

<!-- }}} -->
<!-- }}} -->
<!-- {{{ Ch:Typical operating scenarios -->
<!-- {{{ Chapter top -->
<div class="node">
<p><hr>
<a name="Typical-scenarios"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Usage-reference">Usage reference</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation">Installation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">3 Typical operating scenarios</h2>

<ul class="menu">
<li><a accesskey="1" href="#Computers-on-the-net">Computers on the net</a>:         Your computer is permanently on the Internet (or on
                                a private network with NTP servers)
<li><a accesskey="2" href="#Infrequent-connection">Infrequent connection</a>:        You connect to the Internet sometimes (e.g. via a modem)
<li><a accesskey="3" href="#Isolated-networks">Isolated networks</a>:            You have an isolated network with no reference clocks
<li><a accesskey="4" href="#Dial_002dup-home-PCs">Dial-up home PCs</a>:             Additional considerations if you turn your computer off
                                when it's not in use. 
<li><a accesskey="5" href="#Configuration-options-overview">Configuration options overview</a>:   Overview of some configuration options. 
</ul>
<!-- }}} -->
<!-- {{{ S:Permanent connection -->
<div class="node">
<p><hr>
<a name="Computers-on-the-net"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Infrequent-connection">Infrequent connection</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Typical-scenarios">Typical scenarios</a>
<br>
</div>

<h3 class="section">3.1 Computers connected to the internet</h3>

<p>In this section we discuss how to configure chrony for computers that
have permanent connections to the internet (or to any network
containing true NTP servers which ultimately derive their time from a
reference clock).

   <p>To operate in this mode, you will need to know the names of the NTP
server machines you wish to use.  You may be able to find names of
suitable servers by one of the following methods:

     <ul>
<li>Your institution may already operate servers on its network. 
Contact your system administrator to find out.

     <li>Your ISP probably has one or more NTP servers available for its
customers.

     <li>Somewhere under the NTP homepage there is a list of public
stratum 1 and stratum 2 servers.  You should find one or more servers
that are near to you &mdash; check that their access policy allows you to
use their facilities. 
</ul>

   <p>Assuming that you have found some servers, you need to set up a
configuration file to run chrony.  The (compiled-in) default location
for this file is <span class="file">/etc/chrony.conf</span>.  In the Debian package the
configuration files are in the directory <span class="file">/etc/chrony</span>.  Assuming
that your ntp servers are called <code>a.b.c</code> and <code>d.e.f</code>, your
<span class="file">chrony.conf</span> file could contain as a minimum

<pre class="example">     server a.b.c
     server d.e.f
     server g.h.i
</pre>
   <p>However, you will probably want to include some of the other directives
described later.  The following directives will be particularly useful :
<code>driftfile</code>, <code>commandkey</code>, <code>keyfile</code>.  The smallest
useful configuration file would look something like

<pre class="example">     server a.b.c
     server d.e.f
     server g.h.i
     keyfile /etc/chrony.keys
     commandkey 1
     driftfile /etc/chrony.drift
</pre>
   <!-- }}} -->
<!-- {{{ S:Infrequent connection -->
<div class="node">
<p><hr>
<a name="Infrequent-connection"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Isolated-networks">Isolated networks</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Computers-on-the-net">Computers on the net</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Typical-scenarios">Typical scenarios</a>
<br>
</div>

<h3 class="section">3.2 Infrequent connection to true NTP servers</h3>

<p>In this section we discuss how to configure chrony for computers that
have occasional connections to the internet.

<ul class="menu">
<li><a accesskey="1" href="#Configuration-for-infrequent-connections">Configuration for infrequent connections</a>:   How to set up the <code>/etc/chrony</code> file
<li><a accesskey="2" href="#Advising-chronyd-of-internet-availability">Advising chronyd of internet availability</a>:   How to tell chronyd when the link is available
</ul>

<div class="node">
<p><hr>
<a name="Configuration-for-infrequent-connections"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Advising-chronyd-of-internet-availability">Advising chronyd of internet availability</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Infrequent-connection">Infrequent connection</a>
<br>
</div>

<h4 class="subsection">3.2.1 Setting up the configuration file for infrequent connections</h4>

<p>As in the previous section, you will need access to NTP servers on the
internet.  The same remarks apply for how to find them.

   <p>In this case, you will need some additional configuration to tell
<code>chronyd</code> when the connection to the internet goes up and down. 
This saves the program from continuously trying to poll the servers when
they are inaccessible.

   <p>Again, assuming that your ntp servers are called <code>a.b.c</code> and
<code>d.e.f</code>, your <span class="file">chrony.conf</span> file would need to contain
something like

<pre class="example">     server a.b.c
     server d.e.f
     server g.h.i
</pre>
   <p>However, the following issues need to be addressed:

     <ol type=1 start=1>
<li>Your computer probably doesn't have DNS access whilst offline to turn
the machine names into IP addresses. 
<li>Your computer will keep trying to contact the servers to obtain
timestamps, even whilst offline.  If you operate a dial-on-demand
system, things are even worse, because the link to the internet will
keep getting established.
        </ol>

   <p>For this reason, it would be better to specify this part of your
configuration file in the following way:

<pre class="example">     server 1.2.3.4 offline
     server 5.6.7.8 offline
     server 9.10.11.12 offline
</pre>
   <p>Because numeric IP addresses have been used, the first problem is
overcome.  The <code>offline</code> keyword indicates that the servers start
in an offline state, and that they should not be contacted until <code>chronyd</code>
receives notification that the link to the internet is present.

   <p>An alternative is to use the names of the NTP servers, and put entries for them
into your <span class="file">/etc/hosts</span> file.  This will be OK as long as <span class="samp">files</span>
comes before <span class="samp">dns</span> in the <span class="samp">hosts</span> line of the
<span class="file">/etc/nsswitch.conf</span> file.

   <p>In order to notify <code>chronyd</code> of the presence of the link, you
will need to be able to log in to it with the program chronyc.  To do
this, <code>chronyd</code> needs to be configured with an administrator
password.  The Debian package puts a randomly generated key in
<span class="file">/etc/chrony/chrony.keys</span>.  You should change it.  To set up an
administrator password, you can create a file <span class="file">/etc/chrony.keys</span>
containing a single line

<pre class="example">     1 xyzzy
</pre>
   <p>and add the following line to <span class="file">/etc/chrony.conf</span> (the order of the
lines does not matter)

<pre class="example">     commandkey 1
</pre>
   <p>The smallest useful configuration file would look something like

<pre class="example">     server 1.2.3.4 offline
     server 5.6.7.8 offline
     server 9.10.11.12 offline
     keyfile /etc/chrony.keys
     commandkey 1
     driftfile /etc/chrony.drift
</pre>
   <p>The next section describes how to tell <code>chronyd</code> when the internet link
goes up and down.

<div class="node">
<p><hr>
<a name="Advising-chronyd-of-internet-availability"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Configuration-for-infrequent-connections">Configuration for infrequent connections</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Infrequent-connection">Infrequent connection</a>
<br>
</div>

<h4 class="subsection">3.2.2 How to tell chronyd when the internet link is available.</h4>

<p>To use this option, you will need to configure a command key in
<code>chronyd's</code> configuration file <span class="file">/etc/chrony.conf</span>, as described in
the previous section.

   <p>To tell <code>chronyd</code> when to start and finish sampling the servers, the
<code>online</code> and <code>offline</code> commands of chronyc need to be used. 
To give an example of their use, we assume that <code>pppd</code> is the
program being used to connect to the internet, and that chronyc has been
installed at its default location <span class="file">/usr/local/bin/chronyc</span>.  We
also assume that the command key has been set up as described in the
previous section.

   <p>In the file <span class="file">/etc/ppp/ip-up</span> we add the command sequence

<pre class="example">     /usr/local/bin/chronyc &lt;&lt;EOF
     password xyzzy
     online
     EOF
</pre>
   <p>and in the file <span class="file">/etc/ppp/ip-down</span> we add the sequence

<pre class="example">     /usr/local/bin/chronyc &lt;&lt;EOF
     password xyzzy
     offline
     EOF
</pre>
   <p>The Debian package puts scripts similar to those above in the
directories <span class="file">/etc/ppp/ip-up.d</span> and <span class="file">/etc/ppp/ip-down.d</span>.

   <p><code>chronyd's</code> polling of the servers will now only occur whilst the
machine is actually connected to the Internet. 
<!-- }}} -->
<!-- {{{ S:Isolated networks -->
<div class="node">
<p><hr>
<a name="Isolated-networks"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Dial_002dup-home-PCs">Dial-up home PCs</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Infrequent-connection">Infrequent connection</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Typical-scenarios">Typical scenarios</a>
<br>
</div>

<h3 class="section">3.3 Isolated networks</h3>

<p>In this section we discuss how to configure chrony for computers that
never have network conectivity to any computer which ultimately derives
its time from a reference clock.

   <p>In this situation, one computer is selected to be the master timeserver. 
The other computers are either direct clients of the master, or clients
of clients.

   <p>The rate value in the master's drift file needs to be set to the average
rate at which the master gains or loses time.  <code>chronyd</code> includes
support for this, in the form of the <code>manual</code> directive in the
configuration file and the <code>settime</code> command in the <code>chronyc</code>
program.

   <p>If the master is rebooted, <code>chronyd</code> can re-read the drift rate
from the drift file.  However, the master has no accurate estimate of
the current time.  To get around this, the system can be configured so
that the master can initially set itself to a `majority-vote' of
selected clients' times; this allows the clients to `flywheel' the
master across its outage.

   <p>A typical configuration file for the master (called <code>master</code>) might
be (assuming the clients are in the 192.168.165.x subnet and that the
master's address is 192.168.169.170)

<pre class="example">     driftfile /etc/chrony.drift
     commandkey 25
     keyfile /etc/chrony.keys
     initstepslew 10 client1 client3 client6
     local stratum 8
     manual
     allow 192.168.165
</pre>
   <p>For the clients that have to resynchronise the master when it restarts,
the configuration file might be

<pre class="example">     server master
     driftfile /etc/chrony.drift
     logdir /var/log/chrony
     log measurements statistics tracking
     keyfile /etc/chrony.keys
     commandkey 24
     local stratum 10
     initstepslew 20 master
     allow 192.168.169.170
</pre>
   <p>The rest of the clients would be the same, except that the <code>local</code>
and <code>allow</code> directives are not required. 
<!-- }}} -->
<!-- {{{ S:Dial-up home PCs -->
<div class="node">
<p><hr>
<a name="Dial_002dup-home-PCs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Configuration-options-overview">Configuration options overview</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Isolated-networks">Isolated networks</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Typical-scenarios">Typical scenarios</a>
<br>
</div>

<h3 class="section">3.4 The home PC with a dial-up connection</h3>

<ul class="menu">
<li><a accesskey="1" href="#Dial_002dup-overview">Dial-up overview</a>:             General discussion of how the software operates in this mode
<li><a accesskey="2" href="#Dial_002dup-configuration">Dial-up configuration</a>:        Typical configuration files
</ul>

<div class="node">
<p><hr>
<a name="Dial_002dup-overview"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Dial_002dup-configuration">Dial-up configuration</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Dial_002dup-home-PCs">Dial-up home PCs</a>
<br>
</div>

<h4 class="subsection">3.4.1 Assumptions/how the software works</h4>

<p>This section considers the home computer which has a dial-up connection. 
It assumes that Linux is run exclusively on the computer.  Dual-boot
systems may work; it depends what (if anything) the other system does to
the system's real-time clock.

   <p>Much of the configuration for this case is discussed earlier
(see <a href="#Infrequent-connection">Infrequent connection</a>).  This section addresses specifically
the case of a computer which is turned off between 'sessions'.

   <p>In this case, <code>chronyd</code> relies on the computer's real-time clock
(RTC) to maintain the time between the periods when it is powered up. 
The arrangement is shown in the figure below.

<pre class="example">                 trim if required                          PSTN
           +---------------------------+               +----------+
           |                           |               |          |
           v                           |               |          |
     +---------+                    +-------+       +-----+     +---+
     | System's|  measure error/    |chronyd|       |modem|     |ISP|
     |real-time|-------------------&gt;|       |-------|     |     |   |
     |  clock  |   drift rate       +-------+       +-----+     +---+
     +---------+                       ^                          |
           |                           |                          |
           +---------------------------+                  --o-----o---
              set time at boot up                           |
                                                       +----------+
                                                       |NTP server|
                                                       +----------+
</pre>
   <p>When the computer is connected to the Internet (via the modem),
<code>chronyd</code> has access to external NTP servers which it makes
measurements from.  These measurements are saved, and straight-line fits
are performed on them to provide an estimate of the computer's time
error and rate of gaining/losing time.

   <p>When the computer is taken offline from the Internet, the best estimate
of the gain/loss rate is used to free-run the computer until it next
goes online.

   <p>Whilst the computer is running, <code>chronyd</code> makes measurements of the
real-time clock (RTC) (via the <span class="file">/dev/rtc</span> interface, which must be
compiled into the kernel).  An estimate is made of the RTC error at a
particular RTC second, and the rate at which the RTC gains or loses time
relative to true time.

   <p>The RTC is fully supported in 2.2, 2.4 and 2.6 kernels.

   <p>On 2.6 kernels, if your motherboard has a HPET, you need to enable the
<span class="samp">HPET_EMULATE_RTC</span> option in your kernel configuration.  Otherwise, chrony
will not be able to interact with the RTC device and will give up using it.

   <p>For kernels in the 2.0 series prior to 2.0.32, the kernel was set up to
trim the RTC every 11 minutes.  This would be disasterous for
<code>chronyd</code> &ndash; there is no reliable way of synchronising with this
trimming. For this reason, <code>chronyd</code> only supports the RTC in 2.0
kernels from v2.0.32 onwards.

   <p>When the computer is powered down, the measurement histories for all the
NTP servers are saved to files (if the <code>dumponexit</code> directive is
specified in the configuration file), and the RTC tracking information
is also saved to a file (if the <code>rtcfile</code> directive has been
specified).  These pieces of information are also saved if the
<code>dump</code> and <code>writertc</code> commands respectively are issued through
<code>chronyc</code>.

   <p>When the computer is rebooted, <code>chronyd</code> reads the current RTC time
and the RTC information saved at the last shutdown.  This information is
used to set the system clock to the best estimate of what its time would
have been now, had it been left running continuously.  The measurement
histories for the servers are then reloaded.

   <p>The next time the computer goes online, the previous sessions'
measurements can contribute to the line-fitting process, which gives a
much better estimate of the computer's gain/loss rate.

   <p>One problem with saving the measurements and RTC data when the machine
is shut down is what happens if there is a power failure; the most
recent data will not be saved.  Although <code>chronyd</code> is robust enough
to cope with this, some performance may be lost.  (The main danger
arises if the RTC has been changed during the session, with the
<code>trimrtc</code> command in <code>chronyc</code>.  Because of this,
<code>trimrtc</code> will make sure that a meaningful RTC file is saved out
after the change is completed).

   <p>The easiest protection against power failure is to put the <code>dump</code>
and <code>writertc</code> commands in the same place as the <code>offline</code>
command is issued to take <code>chronyd</code> offline; because <code>chronyd</code>
free-runs between online sessions, no parameters will change
significantly between going offline from the Internet and any power
failure.

   <p>A final point regards home computers which are left running for extended
periods and where it is desired to spin down the hard disc when it is
not in use (e.g. when not accessed for 15 minutes).  <code>chronyd</code> has
been planned so it supports such operation; this is the reason why the
RTC tracking parameters are not saved to disc after every update, but
only when the user requests such a write, or during the shutdown
sequence.  The only other facility that will generate periodic writes to
the disc is the <code>log rtc</code> facility in the configuration file; this
option should not be used if you want your disc to spin down.

<div class="node">
<p><hr>
<a name="Dial_002dup-configuration"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Dial_002dup-overview">Dial-up overview</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Dial_002dup-home-PCs">Dial-up home PCs</a>
<br>
</div>

<h4 class="subsection">3.4.2 Typical configuration files.</h4>

<p>To illustrate how a dial-up home computer might be configured, example
configuration files are shown in this section.

   <p>For the <span class="file">/etc/chrony.conf</span> file, the following can be used as an
example.  <em>NOTE : The </em><code>server</code><em> directives are only applicable
to customers of Demon Internet; users of other ISPs will need to use
their own ISP's NTP servers or public NTP servers.</em>

<pre class="example">     server 158.152.1.65 minpoll 5 maxpoll 10 maxdelay 0.4 offline
     server 158.152.1.76 minpoll 5 maxpoll 10 maxdelay 0.4 offline
     server 194.159.253.2 minpoll 5 maxpoll 10 maxdelay 0.4 offline
     logdir /var/log/chrony
     log statistics measurements tracking
     driftfile /etc/chrony.drift
     keyfile /etc/chrony.keys
     commandkey 25
     maxupdateskew 100.0
     dumponexit
     dumpdir /var/log/chrony
     rtcfile /etc/chrony.rtc
</pre>
   <p>With Freeserve as the ISP, I use the following server lines :

<pre class="example">     server 194.152.64.68 minpoll 5 maxpoll 10 maxdelay 0.4 offline
     server 194.152.64.35 minpoll 5 maxpoll 10 maxdelay 0.4 offline
     server 194.152.64.34 minpoll 5 maxpoll 10 maxdelay 0.4 offline
</pre>
   <p>I use <code>pppd</code> for connecting to my ISP.  This runs two scripts
<span class="file">/etc/ppp/ip-up</span> and <span class="file">/etc/ppp/ip-down</span> when the link goes
online and offline respectively.

   <p>The relevant part of the <span class="file">/etc/ppp/ip-up</span> file is (with a dummy
password)

<pre class="example">     /usr/local/bin/chronyc &lt;&lt;EOF
     password xxxxxxxx
     online
     EOF
</pre>
   <p>and the relevant part of the <span class="file">/etc/ppp/ip-down</span> script is

<pre class="example">     /usr/local/bin/chronyc &lt;&lt;EOF
     password xxxxxxxx
     offline
     dump
     writertc
     EOF
</pre>
   <p>(Because they have to contain the administrator password, it would be
desirable to make the files readable only by root on a multiuser
machine).

   <p>To start <code>chronyd</code> during the boot sequence, I have the following
in <span class="file">/etc/rc.d/rc.local</span> (this is a Slackware system)

<pre class="example">     if [ -f /usr/local/sbin/chronyd -a -f /etc/chrony.conf ]; then
       /usr/local/sbin/chronyd -r -s
       echo "Start chronyd"
     fi
</pre>
   <p>The Debian package puts a script which handles this and shutdown in
<span class="file">/etc/init.d/chrony</span>.

   <p>The placement of this command may be important on some systems.  In
particular, <code>chronyd</code> may need to be started several seconds (about
10 as a minimum) before any software that depends on the system clock
not jumping or moving backwards, depending on the directives in
<code>chronyd's</code> configuration file.

   <p>For the system shutdown, <code>chronyd</code> should receive a SIGTERM several
seconds before the final SIGKILL; the SIGTERM causes the measurement
histories and RTC information to be saved out.  There should be no need
to add anything to the shutdown sequence, unless (as my system had)
there is no pause between the SIGTERM and SIGKILL being delivered to the
remaining processes.  So if you find something like

<pre class="example">     killall5 -15
     killall5 -9
</pre>
   <p>in your <code>/etc/rc.d/rc.0</code> script, you will need to insert a sleep, e.g.

<pre class="example">     killall5 -15
     sleep 5
     killall5 -9
</pre>
   <p>Otherwise, <code>chronyd</code> will not always save information on shutdown,
which could be a problem if you don't use <code>dump</code> and
<code>writertc</code> when you go offline. 
<!-- }}} -->
<!-- {{{ S:Other config options -->
<div class="node">
<p><hr>
<a name="Configuration-options-overview"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Dial_002dup-home-PCs">Dial-up home PCs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Typical-scenarios">Typical scenarios</a>
<br>
</div>

<h3 class="section">3.5 Other important configuration options</h3>

<p>The most common option to include in the configuration file is the
<code>driftfile</code> option.  One of the major tasks of <code>chronyd</code> is to
work out how fast or how slow the system clock runs relative to real
time - e.g. in terms of seconds gained or lost per day.  Measurements
over a long period are usually required to refine this estimate to an
acceptable degree of accuracy.  Therefore, it would be bad if
<code>chronyd</code> had to work the value out each time it is restarted,
because the system clock would not run so accurately whilst the
determination is taking place.

   <p>To avoid this problem, <code>chronyd</code> allows the gain or loss rate to be
stored in a file, which can be read back in when the program is
restarted.  This file is called the drift file, and might typically be
stored in <span class="file">/etc/chrony.drift</span>.  By specifying an option like the
following

<pre class="example">     driftfile /etc/chrony.drift
</pre>
   <p>in the configuration file (<span class="file">/etc/chrony.conf</span>), the drift file
facility will be activated. 
<!-- }}} -->
<!-- }}} -->
<!-- {{{ Ch:Usage reference -->
<div class="node">
<p><hr>
<a name="Usage-reference"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Porting-guide">Porting guide</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Typical-scenarios">Typical scenarios</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">4 Usage reference</h2>

<!-- {{{ Chapter top -->
<ul class="menu">
<li><a accesskey="1" href="#Starting-chronyd">Starting chronyd</a>:             Command line options for the daemon
<li><a accesskey="2" href="#Configuration-file">Configuration file</a>:           Format of the configuration file
<li><a accesskey="3" href="#Running-chronyc">Running chronyc</a>:              The run-time configuration program
</ul>
<!-- }}} -->
<!-- {{{ S:Starting chronyd -->
<div class="node">
<p><hr>
<a name="Starting-chronyd"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Configuration-file">Configuration file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Usage-reference">Usage reference</a>
<br>
</div>

<h3 class="section">4.1 Starting chronyd</h3>

<p>If <code>chronyd</code> has been installed to its default location
<span class="file">/usr/local/sbin/chronyd</span>, starting it is simply a matter of
entering the command

<pre class="example">     /usr/local/sbin/chronyd
</pre>
   <p>The Debian package uses <span class="file">/usr/sbin/chronyd</span>.

   <p>Information messages and warnings will be logged to syslog.

   <p>The command line options supported are as follows:

     <dl>
<dt><code>-d</code><dd>When run in this mode, the program will not detach itself from the
terminal, and all messages will be sent to the terminal instead of to
syslog. 
<br><dt><code>-f &lt;conf-file&gt;</code><dd>This option can be used to specify an alternate location for the
configuration file (default <span class="file">/etc/chrony.conf</span>). 
<br><dt><code>-r</code><dd>This option will reload sample histories for each of the servers being
used.  These histories are created by using the <code>dump</code> command in
<code>chronyc</code>, or by setting the <code>dumponexit</code> directive in the
configuration file.  This option is useful if you want to stop and
restart <code>chronyd</code> briefly for any reason, e.g. to install a new
version.  However, it only makes sense on systems where the kernel can
maintain clock compensation whilst not under <code>chronyd's</code> control. 
The only version where this happens so far is Linux.  On systems where
this is not the case, e.g. Solaris and SunOS the option should not be
used. 
<br><dt><code>-s</code><dd>This option will set the system clock from the computer's real-time
clock.  This is analogous to supplying the `-s' flag to the
<span class="file">/sbin/clock</span> program during the Linux boot sequence.

     <p>Support for real-time clocks is limited at present - the criteria are
described in the section on the <code>rtcfile</code> directive (see <a href="#rtcfile-directive">rtcfile directive</a>).

     <p>If <code>chronyd</code> cannot support the real time clock on your computer,
this option cannot be used and a warning message will be logged to the
syslog.

     <p>If used in conjunction with the `-r' flag, <code>chronyd</code> will attempt
to preserve the old samples after setting the system clock from the real
time clock.  This can be used to allow <code>chronyd</code> to perform long
term averaging of the gain or loss rate across system reboots, and is
useful for dial-up systems that are shut down when not in use.  For this
to work well, it relies on <code>chronyd</code> having been able to determine
accurate statistics for the difference between the real time clock and
system clock last time the computer was on.

     <br><dt><code>-v</code><dd>This option displays <code>chronyd's</code> version number to the terminal and
exits. 
</dl>

   <p>On systems that support an <span class="file">/etc/rc.local</span> file for starting
programs at boot time, <code>chronyd</code> can be started from there.

   <p>On systems with a System V style initialisation (e.g. Solaris), a
suitable start/stop script might be as shown below.  This might be
placed in the file <span class="file">/etc/rc2.d/S83chrony</span>.

<pre class="example">     #!/bin/sh
     # This file should have uid root, gid sys and chmod 744
     #
     
     killproc() {            # kill the named process(es)
             pid=`/usr/bin/ps -e |
                  /usr/bin/grep -w $1 |
                  /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
             [ "$pid" != "" ] &amp;&amp; kill $pid
     }
     
     case "$1" in
     
     'start')
        if [ -f /opt/free/sbin/chronyd -a -f /etc/chrony.conf ]; then
          /opt/free/sbin/chronyd
        fi
        ;;
     'stop')
        killproc chronyd
        ;;
     *)
        echo "Usage: /etc/rc2.d/S83chrony { start | stop }"
        ;;
     esac
</pre>
   <p>(In both cases, you may want to bear in mind that <code>chronyd</code> can
step the time when it starts.  There may be other programs started at
boot time that could be upset by this, so you may need to consider the
ordering carefully.  However, <code>chronyd</code> will need to start after
daemons providing services that it may require, e.g. the domain name
service.) 
<!-- }}} -->
<!-- {{{ S:chronyd configuration file -->
<div class="node">
<p><hr>
<a name="Configuration-file"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Running-chronyc">Running chronyc</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Starting-chronyd">Starting chronyd</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Usage-reference">Usage reference</a>
<br>
</div>

<h3 class="section">4.2 The chronyd configuration file</h3>

<!-- {{{ section top -->
<p>The configuration file is normally called <span class="file">/etc/chrony.conf</span>; in
fact, this is the compiled-in default. However, other locations can be
specified with a command line option.

   <p>Each command in the configuration file is placed on a separate line. 
The following sections describe each of the commands in turn.  The
directives can occur in any order in the file.

<ul class="menu">
<li><a accesskey="1" href="#comments-in-config-file">comments in config file</a>:      How to write a comment
<li><a accesskey="2" href="#acquisitionport-directive">acquisitionport directive</a>:    Set port to use for initial time probes
<li><a accesskey="3" href="#allow-directive">allow directive</a>:              Give access to NTP clients
<li><a accesskey="4" href="#bindaddress-directive">bindaddress directive</a>:        Limit the network interface that is used for NTP
<li><a accesskey="5" href="#bindcmdaddress-directive">bindcmdaddress directive</a>:     Limit the network interface that is used for commands
<li><a accesskey="6" href="#broadcast-directive">broadcast directive</a>:          Make chronyd act as an NTP broadcast server
<li><a accesskey="7" href="#cmdallow-directive">cmdallow directive</a>:           Give control access to chronyc on other computers
<li><a accesskey="8" href="#cmddeny-directive">cmddeny directive</a>:            Deny control access to chronyc on other computers
<li><a accesskey="9" href="#commandkey-directive">commandkey directive</a>:         Set runtime command key
<li><a href="#cmdport-directive">cmdport directive</a>:            Set port to use for runtime commanding
<li><a href="#deny-directive">deny directive</a>:               Deny access to NTP clients
<li><a href="#driftfile-directive">driftfile directive</a>:          Specify location of file containing drift data
<li><a href="#dumpdir-directive">dumpdir directive</a>:            Specify directory for dumping measurements
<li><a href="#dumponexit-directive">dumponexit directive</a>:         Dump measurements when daemon exits
<li><a href="#initstepslew-directive">initstepslew directive</a>:       Trim the system clock on boot-up. 
<li><a href="#keyfile-directive">keyfile directive</a>:            Specify location of file containing keys
<li><a href="#linux_005fhz-directive">linux_hz directive</a>:           Define a non-standard value of the kernel HZ constant
<li><a href="#linux_005ffreq_005fscale-directive">linux_freq_scale directive</a>:   Define a non-standard value to compensate the kernel frequency bias
<li><a href="#local-directive">local directive</a>:              Allow unsynchronised machine to act as server
<li><a href="#log-directive">log directive</a>:                Make daemon log certain sets of information
<li><a href="#logchange-directive">logchange directive</a>:          Generate syslog messages if large offsets occur
<li><a href="#logdir-directive">logdir directive</a>:             Specify directory for logging
<li><a href="#mailonchange-directive">mailonchange directive</a>:       Send email if a clock correction above a threshold occurs
<li><a href="#manual-directive">manual directive</a>:             Allow manual entry using chronyc's settime cmd. 
<li><a href="#maxupdateskew-directive">maxupdateskew directive</a>:      Stop bad estimates upsetting machine clock
<li><a href="#noclientlog-directive">noclientlog directive</a>:        Prevent chronyd from gathering data about clients
<li><a href="#peer-directive">peer directive</a>:               Specify an NTP peer
<li><a href="#pidfile-directive">pidfile directive</a>:            Specify the file where chronyd's pid is written
<li><a href="#port-directive">port directive</a>:               Set port to use for NTP packets
<li><a href="#rtcdevice-directive">rtcdevice directive</a>:          Specify name of enhanced RTC device (if not /dev/rtc)
<li><a href="#rtcfile-directive">rtcfile directive</a>:            Specify the file where real-time clock data is stored
<li><a href="#rtconutc-directive">rtconutc directive</a>:           Specify that the real time clock keeps UTC not local time
<li><a href="#server-directive">server directive</a>:             Specify an NTP server
</ul>
<!-- }}} -->
<!-- {{{ comments in config file -->
<div class="node">
<p><hr>
<a name="comments-in-config-file"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#acquisitionport-directive">acquisitionport directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.1 Comments in the configuration file</h4>

<p>The configuration file may contain comment lines.  A comment line is any line
that starts with zero or more spaces followed by any one of the following
characters:
     <ul>
<li>! 
<li>;
<li>#
<li>%
</ul>
   Any line with this format will be ignored. 
<!-- }}} -->
<!-- {{{ acquisitionport directive -->
<div class="node">
<p><hr>
<a name="acquisitionport-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#allow-directive">allow directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#comments-in-config-file">comments in config file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.2 acquisitionport</h4>

<p><code>chronyd</code> uses a separate client-side port for the rapid-fire
measurements requested with the <code>initstepslew</code> directive
(see <a href="#initstepslew-directive">initstepslew directive</a>).  Normally, that port is chosen
arbitrarily by the operating system.  However, you can use
<code>acquisitionport</code> to explicitly specify a port.  This may be useful
for getting through firewalls.

   <p>Do not make acquisition and regular NTP service (see <a href="#port-directive">port directive</a>)
use the same port.

   <p>An example of the <code>acquisitionport</code> command is

<pre class="example">     acquisitionport 1123
</pre>
   <p>This would change the port used for rapid queries to udp/1123.  You
could then persuade the firewall administrator to let that port through. 
<!-- }}} -->
<!-- {{{ allow -->
<div class="node">
<p><hr>
<a name="allow-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#bindaddress-directive">bindaddress directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#acquisitionport-directive">acquisitionport directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.3 allow</h4>

<p>The <code>allow</code> command is used to designate a particular subnet from
which NTP clients are allowed to access the computer as an NTP server.

   <p>The default is that no clients are allowed access, i.e. <code>chronyd</code>
operates purely as an NTP client.  If the <code>allow</code> directive is
used, <code>chronyd</code> will be both a client of its servers, and a server
to other clients.

   <p>Examples of use of the command are as follows:

<pre class="example">     allow foo.bar.com
     allow 1.2
     allow 3.4.5
     allow 6.7.8/22
     allow 6.7.8.9/22
     allow
</pre>
   <p>The first command allows the named node to be an NTP client of this computer. 
The second command allows any node with an IP address of the form 1.2.x.y (with
x and y arbitrary) to be an NTP client of this computer.  Likewise, the third
command allows any node with an IP address of the form 3.4.5.x to have client
NTP access.  The fourth and fifth forms allow access from any node with an IP
address of the form 6.7.8.x, 6.7.9.x, 6.7.10.x or 6.7.11.x (with x arbitrary),
i.e. the value 22 is the number of bits defining the specified subnet.  (In the
fifth form, the final byte is ignored).  The sixth form allows access by any
node on the entire Internet.

   <p>A second form of the directive, <code>allow all</code>, has a greater effect,
depending on the ordering of directives in the configuration file.  To
illustrate the effect, consider the two examples

<pre class="example">     allow 1.2.3.4
     deny 1.2.3
     allow 1.2
</pre>
   <p>and

<pre class="example">     allow 1.2.3.4
     deny 1.2.3
     allow all 1.2
</pre>
   <p>In the first example, the effect is the same regardles of what order the
three directives are given in.  So the 1.2.x.y subnet is allowed access,
except for the 1.2.3.x subnet, which is denied access, however the host
1.2.3.4 is allowed access.

   <p>In the second example, the <code>allow all 1.2</code> directives overrides the
effect of <em>any</em> previous directive relating to a subnet within the
specified subnet.  Within a configuration file this capability is
probably rather moot; however, it is of greater use for reconfiguration
at run-time via <code>chronyc</code> (see <a href="#allow-all-command">allow all command</a>).

   <p>Note, if the <code>initstepslew</code> directive (see <a href="#initstepslew-directive">initstepslew directive</a>) is used in the configuration file, each of the computers
listed in that directive must allow client access by this computer for
it to work. 
<!-- }}} -->
<!-- {{{ bindaddress -->
<div class="node">
<p><hr>
<a name="bindaddress-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#bindcmdaddress-directive">bindcmdaddress directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#allow-directive">allow directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.4 bindaddress</h4>

<p>The bindaddress allows you to restrict the network interface to which
chronyd will listen for NTP packets.  This provides an additional level of
access restriction above that available through the 'deny' mechanism.

   <p>Suppose you have a local ethernet with addresses in the 192.168.1.0
subnet together with a dial-up connection.  The ethernet interface's IP
address is 192.168.1.1.  Suppose (for some reason) you want to block all
access through the dialup connection (note, this will even block replies
from servers on the dialup side, so you will not be able to synchronise
to an external source).  You could add the line

<pre class="example">     bindaddress 192.168.1.1
</pre>
   <p>to the configuration file.

   <p>This directive affects NTP (UDP port 123) packets.  If no <code>bindcmdaddress</code>
directive is present, the address supplied by <code>bindaddress</code> will be used
to control binding of the command socket (UDP port 323) as well.

   <p>The <code>bindaddress</code> directive has been found to cause problems when used on
computers that need to pass NTP traffic over multiple network interfaces (e.g. 
firewalls).  It is, therefore, not particularly useful.  Use of the
<code>allow</code> and <code>deny</code> directives together with a network firewall is
more likely to be successful.

<!-- }}} -->
<!-- {{{ bindcmdaddress -->
<div class="node">
<p><hr>
<a name="bindcmdaddress-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#broadcast-directive">broadcast directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#bindaddress-directive">bindaddress directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.5 bindcmdaddress</h4>

<p>The bindcmdaddress allows you to restrict the network interface to which
chronyd will listen for command packets (issued by chronyc).

   <p>Suppose you have a local ethernet with addresses in the 192.168.1.0 subnet
together with a dial-up connection.  The ethernet interface's IP address is
192.168.1.1.  Suppose you want to block all access through the dialup
connection.  You could add the line

<pre class="example">     bindcmdaddress 192.168.1.1
</pre>
   <p>to the configuration file.

   <p>The <code>bindcmdaddress</code> directive has been found to cause problems when used
on computers that need to pass command traffic over multiple network
interfaces.  It is, therefore, not particularly useful.  Use of the
<code>cmdallow</code> and <code>cmddeny</code> directives together with a network firewall
is more likely to be successful.

<!-- }}} -->
<!-- {{{ broadcast directive -->
<div class="node">
<p><hr>
<a name="broadcast-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmdallow-directive">cmdallow directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#bindcmdaddress-directive">bindcmdaddress directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.6 broadcast</h4>

<p>The <code>broadcast</code> directive is used to declare a broadcast address to which
chronyd should send packets in NTP broadcast mode (i.e. make chronyd act as a
broadcast server).  Broadcast clients on that subnet will be able to
synchronise.

   <p>The syntax is as follows

<pre class="example">     broadcast 30 192.168.1.255
     broadcast 60 192.168.2.255 12123
</pre>
   <p>In the first example, the destination port defaults to 123/udp (the normal NTP
port).  In the second example, the destionation port is specified as 12123. 
The first parameter in each case (30 or 60 respectively) is the interval in
seconds between broadcast packets being sent.  The second parameter in each
case is the broadcast address to send the packet to.  This should correspond to
the broadcast address of one of the network interfaces on the computer where
chronyd is running.

   <p>You can have more than 1 <code>broadcast</code> directive if you have more than 1
network interface onto which you wish to send NTP broadcast packets.

   <p>Chronyd itself cannot currently act as a broadcast client; it must always be
configured as a point-to-point client by defining specific NTP servers and
peers.  This broadcast server feature is intended for providing a time source
to other NTP software (e.g. various MS Windows clients).

   <p>If xntpd is used as the broadcast client, it will try to use a point-to-point
client/server NTP access to measure the round-trip delay.  Thus, the broadcast
subnet should also be the subject of an <code>allow</code> directive (see <a href="#allow-directive">allow directive</a>). 
<!-- }}} -->
<!-- {{{ cmdallow -->
<div class="node">
<p><hr>
<a name="cmdallow-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmddeny-directive">cmddeny directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#broadcast-directive">broadcast directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.7 cmdallow</h4>

<p>This is similar to the <code>allow</code> directive (see <a href="#allow-directive">allow directive</a>), except
that it allows control access (rather than NTP client access) to a particular
subnet or host.  (By 'control access' is meant that chronyc can be run on those
hosts and successfully connect to chronyd on this computer.)

   <p>The syntax is identical to the <code>allow</code> directive.

   <p>There is also a <code>cmdallow all</code> directive with similar behaviour to the
<code>allow all</code> directive (but applying to control access in this case, of
course). 
<!-- }}} -->
<!-- {{{ cmddeny -->
<div class="node">
<p><hr>
<a name="cmddeny-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#commandkey-directive">commandkey directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmdallow-directive">cmdallow directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.8 cmddeny</h4>

<p>This is similar to the <code>cmdallow</code> directive (see <a href="#cmdallow-directive">cmdallow directive</a>),
except that it denies control access to a particular subnet or host,
rather than allowing it.

   <p>The syntax is identical.

   <p>There is also a <code>cmddeny all</code> directive with similar behaviour to the
<code>cmdallow all</code> directive. 
<!-- }}} -->
<!-- {{{ commandkey -->
<div class="node">
<p><hr>
<a name="commandkey-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmdport-directive">cmdport directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmddeny-directive">cmddeny directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.9 commandkey</h4>

<p>The commandkey command is used to set the key number used for
authenticating user commands via the chronyc program at run time. 
This allows certain actions of the chronyc program to be restricted to
administrators.

   <p>An example of the commandkey command is

<pre class="example">     commandkey 20
</pre>
   <p>In the key file (see the keyfile command) there should be a line of
the form

<pre class="example">     20 foobar
</pre>
   <p>When running the chronyc program to perform run-time configuration,
the command

<pre class="example">     password foobar
</pre>
   <p>must be entered before any commands affecting the operation of the
daemon can be entered. 
<!-- }}} -->
<!-- {{{ cmdport -->
<div class="node">
<p><hr>
<a name="cmdport-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#deny-directive">deny directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#commandkey-directive">commandkey directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.10 cmdport</h4>

<p>The <code>cmdport</code> directive allows the port that is used for run-time
command and monitoring (via the program <code>chronyc</code>) to be altered
from its default (323/udp).

   <p>An example shows the syntax

<pre class="example">     cmdport 257
</pre>
   <p>This would make <code>chronyd</code> use 257/udp as its command port. 
(<code>chronyc</code> would need to be run with the <code>-p 257</code> switch to
inter-operate correctly). 
<!-- }}} -->
<!-- {{{ deny -->
<div class="node">
<p><hr>
<a name="deny-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#driftfile-directive">driftfile directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmdport-directive">cmdport directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.11 deny</h4>

<p>This is similar to the <code>allow</code> directive (see <a href="#allow-directive">allow directive</a>),
except that it denies NTP client access to a particular subnet or host,
rather than allowing it.

   <p>The syntax is identical.

   <p>There is also a <code>deny all</code> directive with similar behaviour to the
<code>allow all</code> directive. 
<!-- }}} -->
<!-- {{{ driftfile -->
<div class="node">
<p><hr>
<a name="driftfile-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#dumpdir-directive">dumpdir directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#deny-directive">deny directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.12 driftfile</h4>

<p>One of the main activities of the <code>chronyd</code> program is to work out
the rate at which the system clock gains or loses time relative to real
time.

   <p>Whenever <code>chronyd</code> computes a new value of the gain/loss rate, it
is desirable to record it somewhere.  This allows <code>chronyd</code> to
begin compensating the system clock at that rate whenever it is
restarted, even before it has had a chance to obtain an equally good
estimate of the rate during the new run.  (This process may take many
minutes, at least).

   <p>The driftfile command allows a file to be specified into which
<code>chronyd</code> can store the rate information.  Two parameters are
recorded in the file.  The first is the rate at which the system clock
gains or loses time, expressed in parts per million, with gains
positive.  Therefore, a value of 100.0 indicates that when the system
clock has advanced by a second, it has gained 100 microseconds on
reality (so the true time has only advanced by 999900 microseconds). 
The second is an estimate of the error bound around the first value in
which the true rate actually lies.

   <p>An example of the driftfile command is

<pre class="example">     driftfile /etc/chrony.drift
</pre>
   <!-- }}} -->
<!-- {{{ dumpdir -->
<div class="node">
<p><hr>
<a name="dumpdir-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#dumponexit-directive">dumponexit directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#driftfile-directive">driftfile directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.13 dumpdir</h4>

<p>To compute the rate of gain or loss of time, <code>chronyd</code> has to store
a measurement history for each of the time sources it uses.

   <p>Certain systems (so far only Linux) have operating system support for
setting the rate of gain or loss to compensate for known errors.  (On
other systems, <code>chronyd</code> must simulate such a capability by
periodically slewing the system clock forwards or backwards by a
suitable amount to compensate for the error built up since the previous
slew).

   <p>For such systems, it is possible to save the measurement history across
restarts of <code>chronyd</code> (assuming no changes are made to the system
clock behaviour whilst it is not running).  If this capability is to be
used (via the dumponexit command in the configuration file, or the dump
command in chronyc), the dumpdir command should be used to define the
directory where the measurement histories are saved.

   <p>An example of the command is

<pre class="example">     dumpdir /var/log/chrony
</pre>
   <p>A source whose IP address is 1.2.3.4 would have its measurement
history saved in the file <span class="file">/var/log/chrony/1.2.3.4.dat</span>. 
<!-- }}} -->
<!-- {{{ dumponexit -->
<div class="node">
<p><hr>
<a name="dumponexit-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#initstepslew-directive">initstepslew directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dumpdir-directive">dumpdir directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.14 dumponexit</h4>

<p>If this command is present, it indicates that <code>chronyd</code> should save
the measurement history for each of its time sources recorded whenever
the program exits.  (See the dumpdir command above). 
<!-- }}} -->
<!-- {{{ initstepslew -->
<div class="node">
<p><hr>
<a name="initstepslew-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#keyfile-directive">keyfile directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dumponexit-directive">dumponexit directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.15 initstepslew</h4>

<p>In normal operation, <code>chronyd</code> always slews the time when it needs to
adjust the system clock.  For example, to correct a system clock which
is 1 second slow, <code>chronyd</code> slightly increases the amount by which the
system clock is advanced on each clock interrupt, until the error is
removed.  (Actually, this is done by calling the <code>adjtime()</code> or
similar system function which does it for us.)  Note that at no time
does time run backwards with this method.

   <p>On most Unix systems it is not desirable to step the system clock,
because many programs rely on time advancing monotonically forwards.

   <p>When the <code>chronyd</code> daemon is initially started, it is possible that the
system clock is considerably in error.  Attempting to correct such an
error by slewing may not be sensible, since it may take several hours
to correct the error by this means.

   <p>The purpose of the <code>initstepslew</code> directive is to allow <code>chronyd</code> to
make a rapid measurement of the system clock error at boot time, and to
correct the system clock by stepping before normal operation begins. 
Since this would normally be performed only at an appropriate point in
the system boot sequence, no other software should be adversely affected
by the step.

   <p>If the correction required is less than a specified threshold, a slew is
used instead.  This makes it easier to restart <code>chronyd</code> whilst the
system is in normal operation.

   <p>The <code>initstepslew</code> directive takes a threshold and a list of NTP
servers as arguments.  A maximum of 8 will be used.  Each of the servers
is rapidly polled several times, and a majority voting mechanism used to
find the most likely range of system clock error that is present.  A
step (or slew) is applied to the system clock to correct this error. 
<code>chronyd</code> then enters its normal operating mode (where only slews are
used).

   <p>An example of use of the command is

<pre class="example">     initstepslew 30 foo.bar.com baz.quz.com
</pre>
   <p>where 2 NTP servers are used to make the measurement.  The <code>30</code>
indicates that if the system's error is found to be 30 seconds or less,
a slew will be used to correct it; if the error is above 30 seconds, a
step will be used.

   <p>The <code>initstepslew</code> directive can also be used in an isolated LAN
environment, where the clocks are set manually.  The most stable
computer is chosen as the master, and the other computers are slaved to
it.  If each of the slaves is configured with the local option (see
below), the master can be set up with an <code>initstepslew</code> directive
which references some or all of the slaves.  Then, if the master machine
has to be rebooted, the slaves can be relied on to 'flywheel' the time
for the master. 
<!-- }}} -->
<!-- {{{ keyfile -->
<div class="node">
<p><hr>
<a name="keyfile-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#linux_005fhz-directive">linux_hz directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#initstepslew-directive">initstepslew directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.16 keyfile</h4>

<p>This command is used to specify the location of the file containing
ID/key pairs for the following 2 uses:

     <ul>
<li>Authentication of NTP packets. 
<li>Authentication of administrator commands entered via chronyc. 
</ul>

   <p>The format of the command is shown in the example below

<pre class="example">     keyfile /etc/chrony.keys
</pre>
   <p>The argument is simply the name of the file containing the ID/key
pairs.  The format of the file is shown below

<pre class="example">     10 tulip
     11 hyacinth
     20 crocus
     25 iris
      ...
</pre>
   <p>Each line consists of an ID and a password.  The ID can be any
unsigned integer in the range 0 through 2**32-1.  The password can be
any string of characters not containing a space.

   <p>For NTP use, the MD5 authentication scheme is always used.  This must be
borne in mind if <code>chronyd</code> is to inter-operate in authenticated
mode with <code>xntpd</code> running on other computers.

   <p>The ID for the chronyc authentication key is specified with the
commandkey command (see earlier). 
<!-- }}} -->
<!-- {{{ local -->
<div class="node">
<p><hr>
<a name="local-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#log-directive">log directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#linux_005ffreq_005fscale-directive">linux_freq_scale directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.17 local</h4>

<p>The local keyword is used to allow <code>chronyd</code> to appear synchronised
to real time (from the viewpoint of clients polling it), even if it has
no current synchronisation source.

   <p>This option is normally used on computers in an isolated network,
where several computers are required to synchronise to one other, this
being the "master" which is kept vaguely in line with real time by
manual input.

   <p>An example of the command is

<pre class="example">     local stratum 10
</pre>
   <p>The value 10 may be substituted with other values in the range 1
through 15.  Stratum 1 indicates a computer that has a true real-time
reference directly connected to it (e.g. GPS, atomic clock etc)
&amp;ndash; such computers are expected to be very close to real time. 
Stratum 2 computers are those which have a stratum 1 server; stratum 3
computers have a stratum 2 server and so on.

   <p>A large value of 10 indicates that the clock is so many hops away from
a reference clock that its time is fairly unreliable.  Put another
way, if the computer ever has access to another computer which is
ultimately synchronised to a reference clock, it will almost certainly
be at a stratum less than 10.  Therefore, the choice of a high value
like 10 for the local command prevents the machine's own time from
ever being confused with real time, were it ever to leak out to
clients that have visibility of real servers. 
<!-- }}} -->
<!-- {{{ linux_hz -->
<div class="node">
<p><hr>
<a name="linux_005fhz-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#linux_005ffreq_005fscale-directive">linux_freq_scale directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#keyfile-directive">keyfile directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.18 linux_hz</h4>

<p>(This option only applies to Linux).

   <p>By default, chronyd will find the value of <code>HZ</code> from a kernel header file
at compile time.  <code>HZ</code> is the nominal number of timer interrupts per
second.  If you're running chronyd on the system where it was built, the value
it has should be right, and you don't need to worry about this option.

   <p>This option is provided for people who move a pre-built chronyd onto a system
where the value of HZ in the kernel headers has been changed from the default
value.

   <p>An example of the command is

<pre class="example">     linux_hz 100
</pre>
   <!-- }}} -->
<!-- {{{ linux_freq_scale -->
<div class="node">
<p><hr>
<a name="linux_005ffreq_005fscale-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#local-directive">local directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#linux_005fhz-directive">linux_hz directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.19 linux_freq_scale</h4>

<p>(This option only applies to Linux).

   <p>By default, chronyd will find the value of <code>HZ</code> and <code>SHIFT_HZ</code> from
kernel header files at compile time.  An internal value called
<code>freq_scale</code> is calculated from this.  By default it is (1&lt;&lt;SHIFT_HZ)/HZ,
except for the case HZ=100, when special case code is used which leads to the
value 128/128.125.  If you're running chronyd on the system where it was built,
the value it has should be right, and you don't need to worry about this
option.

   <p>This option is provided for people who move a pre-built chronyd onto a system
where the method by which the kernel computes the reciprocal of this value has been changed or where the HZ and SHIFT_HZ constants differ from those on the system where chronyd was built.

   <p>An example of the command is

<pre class="example">     linux_freq_scale 0.99902439
</pre>
   <!-- }}} -->
<!-- {{{ log -->
<div class="node">
<p><hr>
<a name="log-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#logchange-directive">logchange directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#local-directive">local directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.20 log</h4>

<!-- {{{ section top -->
<p>The log command indicates that certain information is to be logged.

     <dl>
<dt><code>measurements</code><dd>This option logs the raw NTP measurements and related information to a
file called measurements.log.

     <br><dt><code>statistics</code><dd>This option logs information about the regression processing to a file
called statistics.log.

     <br><dt><code>tracking</code><dd>This option logs changes to the estimate of the system's gain or loss
rate, and any slews made, to a file called tracking.log.

     <br><dt><code>rtc</code><dd>This option logs information about the system's real-time clock. 
</dl>

   <p>The files are written to the directory specified by the logdir
command.

   <p>An example of the command is

<pre class="example">     log measurements statistics tracking
</pre>
   <ul class="menu">
<li><a accesskey="1" href="#measurements-log">measurements log</a>:             The format of the measurements log
<li><a accesskey="2" href="#statistics-log">statistics log</a>:               The format of the statistics log
<li><a accesskey="3" href="#tracking-log">tracking log</a>:                 The format of the tracking log
<li><a accesskey="4" href="#RTC-log">RTC log</a>:                      The format of the RTC log
</ul>
<!-- }}} -->
<!-- {{{ measurements.log -->
<div class="node">
<p><hr>
<a name="measurements-log"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#statistics-log">statistics log</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#log-directive">log directive</a>
<br>
</div>

<h5 class="subsubsection">4.2.20.1 Measurements log file format</h5>

<p>An example line (which actually appears as a single line in the file)
from the measurements log file is shown below.

<pre class="example">     1998-07-22 05:40:50 158.152.1.76    N  8 1111 11 1111 10 10  1 \
        -4.966e-03  2.296e-01  1.577e-05  1.615e-01  7.446e-03
</pre>
   <p>The columns are as follows (the quantities in square brackets are the
values from the example line above) :

     <ol type=1 start=1>
<li>Date [1998-07-22]
<li>Hour:Minute:Second [05:40:50].  Note that the date/time pair is
expressed in UTC, not the local time zone. 
<li>IP address of server/peer from which measurement comes [158.152.1.76]
<li>Leap status (<code>N</code> means normal, <code>-</code> means that the last minute
of today has 61 seconds, <code>+</code> means that the last minute of the day
has 59 seconds, <code>?</code> means the remote computer is not currently
synchronised.) [N]
<li>Stratum of remote computer. [2]
<li>RFC1305 tests 1 through 4 (1=pass, 0=fail) [1111]
<li>Tests for maximum delay and maximum delay ratio, against user defined
parameters (1=pass, 0=fail) [11]
<li>RFC1305 tests 5 through 8 (1=pass, 0=fail) [1111]
<li>Local poll [10]
<li>Remote poll [10]
<li>`Score' (an internal score within each polling level used to decide when
to increase or decrease the polling level.  This is adjusted based on
changes to the variance of the measurements obtained from the source). [1]
<li>The estimated local clock error (`theta' in RFC1305).  Positive indicates that the local clock is slow. [-4.966e-03]. 
<li>The peer delay (`delta' in RFC1305). [2.296e-01]
<li>The peer dispersion (`epsilon' in RFC1305). [1.577e-05]
<li>The root delay (`Delta' in RFC1305). [1.615e-01]
<li>The root dispersion (`E' in RFC1305). [7.446e-03]
        </ol>

   <p>A banner is periodically written to the log file to indicate the
meanings of the columns. 
<!-- }}} -->
<!-- {{{ statistics.log -->
<div class="node">
<p><hr>
<a name="statistics-log"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#tracking-log">tracking log</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#measurements-log">measurements log</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#log-directive">log directive</a>
<br>
</div>

<h5 class="subsubsection">4.2.20.2 Statistics log file format</h5>

<p>An example line (which actually appears as a single line in the file)
from the measurements log file is shown below.

<pre class="example">     1998-07-22 05:40:50 158.152.1.76     6.261e-03 -3.247e-03 \
          2.220e-03  1.874e-06  1.080e-06 7.8e-02  16   0   8
</pre>
   <p>The columns are as follows (the quantities in square brackets are the
values from the example line above) :

     <ol type=1 start=1>
<li>Date [1998-07-22]
<li>Hour:Minute:Second [05:40:50].  Note that the date/time pair is
expressed in UTC, not the local time zone. 
<li>IP address of server/peer from which measurement comes [158.152.1.76]
<li>The estimated standard deviation of the measurements from the source (in
seconds). [6.261e-03]
<li>The estimated offset of the source (in seconds, positive means the local
clock is estimated to be fast, in this case). [-3.247e-03]
<li>The estimated standard deviation of the offset estimate (in
seconds). [2.220e-03]
<li>The estimated rate at which the local clock is gaining or losing time
relative to the source (in seconds per second, positive means the local
clock is gaining).  This is relative to the compensation currently being
applied to the local clock, <em>not</em> to the local clock without any
compensation. [1.874e-06]
<li>The estimated error in the rate value (in seconds per
second). [1.080e-06]. 
<li>The ration of |old_rate - new_rate| / old_rate_error.  Large values
indicate the statistics are not modelling the source very well. [7.8e-02]
<li>The number of measurements currently being used for the regression
algorithm. [16]
<li>The new starting index (the oldest sample has index 0; this is the
method used to prune old samples when it no longer looks like the
measurements fit a linear model). [0, i.e. no samples discarded this
time]
<li>The number of runs.  The number of runs of regression residuals with the
same sign is computed.  If this is too small it indicates that the
measurements are no longer represented well by a linear model and that
some older samples need to be discarded.  The number of runs for the
data that is being retained is tabulated.  Values of approximately half
the number of samples are expected. [8]
        </ol>

   <p>A banner is periodically written to the log file to indicate the
meanings of the columns. 
<!-- }}} -->
<!-- {{{ tracking.log -->
<div class="node">
<p><hr>
<a name="tracking-log"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#RTC-log">RTC log</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#statistics-log">statistics log</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#log-directive">log directive</a>
<br>
</div>

<h5 class="subsubsection">4.2.20.3 Tracking log file format</h5>

<p>An example line (which actually appears as a single line in the file)
from the measurements log file is shown below.

<pre class="example">     1998-07-22 05:40:50 158.152.1.76     3    340.529      1.606  1.046e-03
</pre>
   <p>The columns are as follows (the quantities in square brackets are the
values from the example line above) :

     <ol type=1 start=1>
<li>Date [1998-07-22]
<li>Hour:Minute:Second [05:40:50].  Note that the date/time pair is
expressed in UTC, not the local time zone. 
<li>The IP address of the server/peer to which the local system is
synchronised. [158.152.1.76]
<li>The stratum of the local system. [3]
<li>The local system frequency (in ppm, positive means the local system runs
fast of UTC). [340.529]
<li>The error bounds on the frequency (in ppm) [1.606]
<li>The estimated local offset at the epoch (which is rapidly corrected by
slewing the local clock.  (In seconds, positive indicates the local
system is fast of UTC). [1.046e-3]
        </ol>

   <p>A banner is periodically written to the log file to indicate the
meanings of the columns. 
<!-- }}} -->
<!-- {{{ rtc.log -->
<div class="node">
<p><hr>
<a name="RTC-log"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#tracking-log">tracking log</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#log-directive">log directive</a>
<br>
</div>

<h5 class="subsubsection">4.2.20.4 Real-time clock log file format</h5>

<p>An example line (which actually appears as a single line in the file)
from the measurements log file is shown below.

<pre class="example">     1998-07-22 05:40:50     -0.037360 1       -0.037434\
               -37.948  12   5  120
</pre>
   <p>The columns are as follows (the quantities in square brackets are the
values from the example line above) :

     <ol type=1 start=1>
<li>Date [1998-07-22]
<li>Hour:Minute:Second [05:40:50].  Note that the date/time pair is
expressed in UTC, not the local time zone. 
<li>The measured offset between the system's real time clock and the system
(<code>gettimeofday()</code>) time.  In seconds, positive indicates that the
RTC is fast of the system time. [-0.037360]. 
<li>Flag indicating whether the regression has produced valid
coefficients. (1 for yes, 0 for no). [1]
<li>Offset at the current time predicted by the regression process.  A large
difference between this value and the measured offset tends to indicate
that the measurement is an outlier with a serious measurement
error. [-0.037434]. 
<li>The rate at which the RTC is losing or gaining time relative to the
system clock.  In ppm, with positive indicating that the RTC is gaining
time. [-37.948]
<li>The number of measurements used in the regression. [12]
<li>The number of runs of regression residuals of the same sign.  Low values
indicate that a straight line is no longer a good model of the measured
data and that older measurements should be discarded. [5]
<li>The measurement interval used prior to the measurement being made (in
seconds). [120]
        </ol>

   <p>A banner is periodically written to the log file to indicate the
meanings of the columns. 
<!-- }}} -->
<!-- }}} -->
<!-- {{{ logchange -->
<div class="node">
<p><hr>
<a name="logchange-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#logdir-directive">logdir directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#log-directive">log directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.21 logchange</h4>

<p>This directive forces <code>chronyd</code> to send a message to syslog if it
makes a system clock adjustment larger than a threshold value.  An
example of use is

<pre class="example">     logchange 0.5
</pre>
   <p>which would cause a syslog message to be generated a system clock error
of over 0.5 seconds starts to be compensated.

   <p>Clock errors detected either via NTP packets or via timestamps entered
via the <code>settime</code> command of <code>chronyc</code> are logged.

   <p>This directive assumes that syslog messages are appearing where somebody
can see them.  This allows that person to see if a large error has
arisen, e.g. because of a fault, or because of faulty timezone handling,
for example when summer time (daylight saving) starts or ends. 
<!-- }}} -->
<!-- {{{ logdir -->
<div class="node">
<p><hr>
<a name="logdir-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#mailonchange-directive">mailonchange directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#logchange-directive">logchange directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.22 logdir</h4>

<p>This directive allows the directory where log files are written to be
specified.

   <p>An example of the use of this directive is

<pre class="example">     logdir /var/log/chrony
</pre>
   <!-- }}} -->
<!-- {{{ mailonchange -->
<div class="node">
<p><hr>
<a name="mailonchange-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#manual-directive">manual directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#logdir-directive">logdir directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.23 mailonchange</h4>

<p>This directive defines an email address to which mail should be sent if
chronyd applies a correction exceeding a particular threshold to the
system clock.

   <p>An example of use of this directive is

<pre class="example">     mailonchange root@localhost 0.5
</pre>
   <p>This would send a mail message to root if a change of more than 0.5
seconds were applied to the system clock. 
<!-- }}} -->
<!-- {{{ manual -->
<div class="node">
<p><hr>
<a name="manual-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#maxupdateskew-directive">maxupdateskew directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#mailonchange-directive">mailonchange directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.24 manual</h4>

<p>The <code>manual</code> directive enables support at run-time for the
<code>settime</code> command in chronyc (see <a href="#settime-command">settime command</a>).  If no
<code>manual</code> directive is included, any attempt to use the
<code>settime</code> command in chronyc will be met with an error message.

   <p>Note that the <code>settime</code> command can be enabled at run-time using
the <code>manual</code> command in chronyc (see <a href="#manual-command">manual command</a>).  (The
idea of the two commands is that the <code>manual</code> command controls the
manual clock driver's behaviour, whereas the <code>settime</code> command
allows samples of manually entered time to be provided). 
<!-- }}} -->
<!-- {{{ maxupdateskew -->
<div class="node">
<p><hr>
<a name="maxupdateskew-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#noclientlog-directive">noclientlog directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#manual-directive">manual directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.25 maxupdateskew</h4>

<p>One of <code>chronyd's</code> tasks is to work out how fast or slow the computer's
clock runs relative to its reference sources.  In addition, it computes
an estimate of the error bounds around the estimated value.

   <p>If the range of error is too large, it probably indicates that the
measurements have not settled down yet, and that the estimated gain or
loss rate is not very reliable.

   <p>The <code>maxupdateskew</code> parameter allows the threshold for determining
whether an estimate may be so unreliable that it should not be used.

   <p>The syntax is

<pre class="example">     maxupdateskew &lt;skew-in-ppm&gt;
</pre>
   <p>Typical values for &lt;skew-in-ppm&gt; might be 100 for a dial-up connection
to servers over a phone line, and 5 or 10 for a computer on a LAN.

   <p>It should be noted that this is not the only means of protection against
using unreliable estimates.  At all times, <code>chronyd</code> keeps track of
both the estimated gain or loss rate, and the error bound on the
estimate.  When a new estimate is generated following another
measurement from one of the sources, a weighted combination algorithm is
used to update the master estimate.  So if <code>chronyd</code> has an existing
highly-reliable master estimate and a new estimate is generated which
has large error bounds, the existing master estimate will dominate in
the new master estimate. 
<!-- }}} -->
<!-- {{{ noclientlog -->
<div class="node">
<p><hr>
<a name="noclientlog-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#peer-directive">peer directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#maxupdateskew-directive">maxupdateskew directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.26 noclientlog</h4>

<p>This directive, which takes no arguments, specifies that client accesses
are not to be logged.  Normally they are logged, allowing statistics to
be reported using the <code>clients</code> command in <code>chronyc</code>. 
<!-- }}} -->
<!-- {{{ peer -->
<div class="node">
<p><hr>
<a name="peer-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#pidfile-directive">pidfile directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#noclientlog-directive">noclientlog directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.27 peer</h4>

<p>The syntax of this directive is identical to that for the <code>server</code>
directive (see <a href="#server-directive">server directive</a>), except that it is used to specify
an NTP peer rather than an NTP server. 
<!-- }}} -->
<!-- {{{ pidfile -->
<div class="node">
<p><hr>
<a name="pidfile-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#port-directive">port directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#peer-directive">peer directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.28 pidfile</h4>

<p>chronyd always writes its process ID (pid) to a file, and checks this file on startup to see if another chronyd may already be running on the system.  By default, the file used is <code>/var/run/chronyd.pid</code>.  The <code>pidfile</code> directive allows the name to be changed, e.g.

<pre class="example">     pidfile /var/tmp/chronyd.pid
</pre>
   <!-- }}} -->
<!-- {{{ port -->
<div class="node">
<p><hr>
<a name="port-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#rtcdevice-directive">rtcdevice directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pidfile-directive">pidfile directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.29 port</h4>

<p>This option allows you to configure the port used for the NTP service
on your machine.

   <p>The compiled in default is udp/123, the standard NTP port.  It is
unlikely that you would ever need to change this value.  A possible
exception would be if you wanted to operate strictly in client-only
mode and never be available as a server to xntpd clients.

   <p>An example of the port command is

<pre class="example">     port 11123
</pre>
   <p>This would change the NTP port served by chronyd on the computer to
udp/11123. 
<!-- }}} -->
<!-- {{{ rtcdevice -->
<div class="node">
<p><hr>
<a name="rtcdevice-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#rtcfile-directive">rtcfile directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#port-directive">port directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.30 rtcdevice</h4>

<p>The <code>rtcdevice</code> directive defines the name of the device file for
accessing the real time clock.  By default this is <code>/dev/rtc/</code>, unless the
directive is used to set a different value.  This applies to Linux systems with
devfs.  An example of use is

<pre class="example">     rtcdevice /dev/misc/rtc
</pre>
   <!-- }}} -->
<!-- {{{ rtcfile -->
<div class="node">
<p><hr>
<a name="rtcfile-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#rtconutc-directive">rtconutc directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#rtcdevice-directive">rtcdevice directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.31 rtcfile</h4>

<p>The <code>rtcfile</code> directive defines the name of the file in which
<code>chronyd</code> can save parameters associated with tracking the accuracy
of the system's real-time clock (RTC).

   <p>The syntax is illustrated in the following example

<pre class="example">     rtcfile /etc/chrony.rtc
</pre>
   <p><code>chronyd</code> saves information in this file when it exits and when the
<code>writertc</code> command is issued in <code>chronyc</code>.  The information
saved is the RTC's error at some epoch, that epoch (in seconds since
January 1 1970), and the rate at which the RTC gains or loses time.

   <p>So far, the support for real-time clocks is limited - their code is even
more system-specific than the rest of the software.  You can only use
the real time clock facilities (the <code>rtcfile</code> directive and the
<code>-s</code> command line option to <code>chronyd</code>) if the following three
conditions apply:

     <ol type=1 start=1>
<li>You are running Linux version 2.2.x or 2.4.x (for any value of x), or v2.0.x
with x&gt;=32.

     <li>You have compiled the kernel with extended real-time clock support
(i.e. the <span class="file">/dev/rtc</span> device is capable of doing useful things).

     <li>You don't have other applications that need to make use of
<span class="file">/dev/rtc</span> at all.

        </ol>
<!-- }}} -->
<!-- {{{ rtconutc -->
<div class="node">
<p><hr>
<a name="rtconutc-directive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#server-directive">server directive</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#rtcfile-directive">rtcfile directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.32 rtconutc</h4>

<p><code>chronyd</code> assumes by default that the real time clock (RTC) keeps
local time (including any daylight saving changes).  This is convenient
on PCs running Linux which are dual-booted with DOS or Windows.

   <p>NOTE : IF YOU KEEP THE REAL TIME CLOCK ON LOCAL TIME AND YOUR COMPUTER
IS OFF WHEN DAYLIGHT SAVING (SUMMER TIME) STARTS OR ENDS, THE COMPUTER'S
SYSTEM TIME WILL BE ONE HOUR IN ERROR WHEN YOU NEXT BOOT AND START
CHRONYD.

   <p>An alternative is for the RTC to keep Universal Coordinated Time (UTC). 
This does not suffer from the 1 hour problem when daylight saving starts
or ends.

   <p>If the <code>rtconutc</code> directive appears, it means the RTC is required
to keep UTC.  The directive takes no arguments.  It is equivalent to
specifying the <code>-u</code> switch to the Linux <span class="file">/sbin/clock</span> program. 
<!-- }}} -->
<!-- {{{ server -->
<div class="node">
<p><hr>
<a name="server-directive"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#rtconutc-directive">rtconutc directive</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration-file">Configuration file</a>
<br>
</div>

<h4 class="subsection">4.2.33 server</h4>

<p>The <code>server</code> directive allows NTP servers to be specified.  The
client/server relationship is strictly hierarchical : a client may
synchronise its system time to that of the server, but the server's
system time will never be influenced by that of a client.

   <p>The <code>server</code> directive is immediately followed by either the name
of the server, or its IP address in dotted-quad notation.  The server
command also supports a number of subfields (which may be defined in any
order):

     <dl>
<dt><code>port</code><dd>This option allows the UDP port on which the server understands NTP
requests to be specified.  For normal servers this option should not be
required (the default is 123, the standard NTP port). 
<br><dt><code>minpoll</code><dd>Although <code>chronyd</code> will trim the rate at which it samples the
server during normal operation, the user may wish to constrain the
minimum polling interval.  This is always defined as a power of 2, so
&lt;tt/minpoll 5/ would mean that the polling interval cannot drop below 32
seconds.  The default is 6 (64 seconds). 
<br><dt><code>maxpoll</code><dd>In a similar way, the user may wish to constrain the maximum polling
interval.  Again this is specified as a power of 2, so &lt;tt/maxpoll 9/
indicates that the polling interval must stay at or below 512 seconds. 
The default is 10 (1024 seconds). 
<br><dt><code>maxdelay</code><dd><code>chronyd</code> uses the network round-trip delay to the server to
determine how accurate a particular measurement is likely to be.  Long
round-trip delays indicate that the request, or the response, or both
were delayed.  If only one of the messages was delayed the measurement
error is likely to be substantial.

     <p>For small variations in round trip delay, <code>chronyd</code> uses a
weighting scheme when processing the measurements.  However, beyond a
certain level of delay the measurements are likely to be so corrupted as
to be useless.  (This is particularly so on dial-up or other slow links,
where a long delay probably indicates a highly asymmetric delay caused
by the response waiting behind a lot of packets related to a download of
some sort).

     <p>If the user knows that round trip delays above a certain level should
cause the measurement to be ignored, this level can be defined with the
maxdelay command.  For example, &lt;tt/maxdelay 0.3/ would indicate that
measurements with a round-trip delay of 0.3 seconds or more should be
ignored.

     <br><dt><code>maxdelayratio</code><dd>This option is similar to the maxdelay option above.  <code>chronyd</code>
keeps a record of the minimum round-trip delay amongst the previous
measurements that it has buffered.  If a measurement has a round trip
delay that is greater than the maxdelayratio times the minimum delay, it
will be rejected.

     <br><dt><code>presend</code><dd>If the timing measurements being made by <code>chronyd</code> are the only
network data passing between two computers, you may find that some
measurements are badly skewed due to either the client or the server
having to do an ARP lookup on the other party prior to transmitting a
packet.  This is more of a problem with long sampling intervals, which
may be similar in duration to the lifetime of entries in the ARP caches
of the machines.

     <p>In order to avoid this problem, the <code>presend</code> option may be used. 
It takes a single integer argument, which is the smallest polling
interval for which a pair of packets will be exchanged between the
client and the server prior to the actual measurement being initiated by
the client.  For example, with the following option included in a
<code>server</code> directive :

     <pre class="example">          presend 9
     </pre>
     <p>when the polling interval is 512 seconds or more, a UDP echo datagram
will be sent to the server a short time (currently 4 seconds) before the
NTP client mode datagram.

     <br><dt><code>key</code><dd>The NTP protocol supports the inclusion of checksums in the packets, to
prevent computers having their system time upset by rogue packets being
sent to them.  The checksums are generated as a function of a password,
using the MD5 algorithm.

     <p>The association between key numbers and passwords is contained in the
keys file, defined by the keyfile command.

     <p>If the key option is present, <code>chronyd</code> will attempt to use
authenticated packets when communicating with this server.  The key
number used will be the single argument to the key option.  The server
must have the same password for this key number configured, otherwise no
relationship between the computers will be possible.

     <br><dt><code>offline</code><dd>If the server will not be reachable when <code>chronyd</code> is started, the
offline option may be specified.  <code>chronyd</code> will not try to poll
the server until it is enabled to do so (by using the online option of
<code>chronyc</code>).

     <br><dt><code>auto_offline</code><dd>If this option is set, the server will be assumed to have gone offline when 2
requests have been sent to it without receiving a response.  This option avoids
the need to run the <code>offline</code> (see <a href="#offline-command">offline command</a>) command from
chrony when disconnecting the dial-up link.  (It will still be necessary to use
chronyc's <code>online</code> (see <a href="#online-command">online command</a>) command when the link has been
established, to enable measurements to start.)

   </dl>
   <!-- }}} -->
<!-- }}} -->
<!-- {{{ S:Running chronyc -->
<div class="node">
<p><hr>
<a name="Running-chronyc"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Configuration-file">Configuration file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Usage-reference">Usage reference</a>
<br>
</div>

<h3 class="section">4.3 Running chronyc</h3>

<!-- {{{ Section top -->
<p>Chronyc is the program that can be used to reconfigure options within
the <code>chronyd</code> program whilst it is running.  Chronyc can also be
used to generate status reports about the operation of <code>chronyd</code>.

<ul class="menu">
<li><a accesskey="1" href="#Chronyc-basic-use">Chronyc basic use</a>:            How to run chronyc
<li><a accesskey="2" href="#Chronyc-command-line-options">Chronyc command line options</a>:   Chrony's command line options
<li><a accesskey="3" href="#Security-with-chronyc">Security with chronyc</a>:        How chronyd restricts access
<li><a accesskey="4" href="#Chronyc-command-reference">Chronyc command reference</a>:    All the commands chronyc supports
</ul>
<!-- }}} -->
<!-- {{{ SS:Chronyc basic use -->
<div class="node">
<p><hr>
<a name="Chronyc-basic-use"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Chronyc-command-line-options">Chronyc command line options</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Running-chronyc">Running chronyc</a>
<br>
</div>

<h4 class="subsection">4.3.1 Basic use</h4>

<p>The program chronyc is run by entering

<pre class="example">     chronyc
</pre>
   <p>at the command line.  The prompt <code>chronyc</code> is displayed whilst
chronyc is expecting input from the user, when it is being run from a
terminal.  If chronyc's input or output are redirected from/to a file,
the prompt is now shown.

   <p>When you are finished entering commands, the commands <code>exit</code> or
<code>quit</code> will terminate the program.  (Entering &lt;Control-D&gt; will
also terminate the program.) 
<!-- }}} -->
<!-- {{{ SS:Command line options -->
<div class="node">
<p><hr>
<a name="Chronyc-command-line-options"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Security-with-chronyc">Security with chronyc</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Chronyc-basic-use">Chronyc basic use</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Running-chronyc">Running chronyc</a>
<br>
</div>

<h4 class="subsection">4.3.2 Command line options</h4>

<p>Chronyc supports the following command line options.

     <dl>
<dt><code>-v</code><dd>Displays the version number of chronyc on the terminal, and exists. 
<br><dt><code>-h &lt;host&gt;</code><dd>This option allows the user to specify which host running the
<code>chronyd</code> program is to be contacted.  This allows for remote
configuration, without having to telnet or rlogin to the other host
first.

     <p>The default is to contact <code>chronyd</code> running on the same host as
that where chronyc is being run. 
<br><dt><code>-p &lt;port&gt;</code><dd>This option allows the user to specify the UDP port number which the
target <code>chronyd</code> is using for its command &amp; monitoring connections. 
This defaults to the compiled-in default; there would rarely be a need
to change this. 
</dl>
   <!-- }}} -->
<!-- {{{ SS:Security with chronyc -->
<div class="node">
<p><hr>
<a name="Security-with-chronyc"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Chronyc-command-reference">Chronyc command reference</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Chronyc-command-line-options">Chronyc command line options</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Running-chronyc">Running chronyc</a>
<br>
</div>

<h4 class="subsection">4.3.3 Security with chronyc</h4>

<p>Many of the commands available through chronyc have a fair amount of
power to reconfigure the run-time behaviour of <code>chronyd</code>.  Consequently,
<code>chronyc</code> is quite dangerous for the integrity of the target
system's clock performance.  Having access to <code>chronyd</code> via chronyc is
more or less equivalent to being able to modify <code>chronyd's</code> configuration
file (typically <span class="file">/etc/chrony.conf</span>) and to restart <code>chronyd</code>.

   <p>Chronyc also provides a number of monitoring (as opposed to commanding)
commands, which will not affect the behaviour of <code>chronyd</code>.  However, you
may still want to restrict access to these commands.

   <p>In view of this, access to some of the capabilities of chronyc will
usually be tightly controlled.  There are two mechanisms supported:

     <ol type=1 start=1>
<li>The set of hosts from which <code>chronyd</code> will accept commands can be
restricted.  By default, commands will only be accepted from the same
host that <code>chronyd</code> is running on. 
<li>Any command that actually reconfigures some aspect of <code>chronyd's</code>
behaviour requires the user of chronyc to know a password.  This
password is specified in <code>chronyd's</code> keys file (see <a href="#keyfile-directive">keyfile directive</a>)
and specified via the commandkey option in its configuration file
(see <a href="#commandkey-directive">commandkey directive</a>).
        </ol>

   <p>Only the following commands can be used <em>without</em> providing a
password:

     <ul>
<li><code>exit</code>
<li><code>help</code>
<li><code>password</code>
<li><code>quit</code>
<li><code>rtcdata</code>
<li><code>sources</code>
<li><code>sourcestats</code>
<li><code>tracking</code>
</ul>

   <p>All other commands require a password to have been specified previously,
because they affect <code>chronyd's</code> operation. 
<!-- }}} -->
<!-- {{{ SS:Chronyc command reference -->
<div class="node">
<p><hr>
<a name="Chronyc-command-reference"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Security-with-chronyc">Security with chronyc</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Running-chronyc">Running chronyc</a>
<br>
</div>

<h4 class="subsection">4.3.4 Command reference</h4>

<!-- {{{ Top/menu -->
<p>This section describes each of the commands available within the chronyc
program.  Chronyc offers the user a simple command-line driven
interface.

<ul class="menu">
<li><a accesskey="1" href="#accheck-command">accheck command</a>:              Verifying NTP client access
<li><a accesskey="2" href="#activity-command">activity command</a>:             Check how many NTP servers/peers are online/offline
<li><a accesskey="3" href="#add-peer-command">add peer command</a>:             Add a new NTP peer
<li><a accesskey="4" href="#add-server-command">add server command</a>:           Add a new NTP server
<li><a accesskey="5" href="#allow-command">allow command</a>:                Allowing NTP client access
<li><a accesskey="6" href="#allow-all-command">allow all command</a>:            Allowing NTP client access
<li><a accesskey="7" href="#burst-command">burst command</a>:                Initiating a rapid set of measurements
<li><a accesskey="8" href="#clients-command">clients command</a>:              Show clients that have accessed the server
<li><a accesskey="9" href="#cmdaccheck-command">cmdaccheck command</a>:           Verifying command client access
<li><a href="#cmdallow-command">cmdallow command</a>:             Allowing command client access
<li><a href="#cmdallow-all-command">cmdallow all command</a>:         Allowing command client access
<li><a href="#cmddeny-command">cmddeny command</a>:              Denying command client access
<li><a href="#cmddeny-all-command">cmddeny all command</a>:          Denying command client access
<li><a href="#cyclelogs-command">cyclelogs command</a>:            Close and re-open open log files
<li><a href="#delete-command">delete command</a>:               Remove an NTP server or peer
<li><a href="#deny-command">deny command </a>:                Denying NTP client access
<li><a href="#deny-all-command">deny all command</a>:             Denying NTP client access
<li><a href="#dump-command">dump command</a>:                 Dump measurement histories to files
<li><a href="#exit-command">exit command</a>:                 Exit from chronyc
<li><a href="#help-command">help command</a>:                 Generate help summary
<li><a href="#local-command">local command</a>:                Let computer be a server when it is unsynchronised
<li><a href="#makestep-command">makestep command</a>:             Immediately correct the system clock instead of slewing
<li><a href="#manual-command">manual command</a>:               Enable/disable/configure options for settime
<li><a href="#maxdelay-command">maxdelay command</a>:             Set max measurement delay for a source
<li><a href="#maxdelayratio-command">maxdelayratio command</a>:        Set max measurement delay for a source as ratio
<li><a href="#maxpoll-command">maxpoll command</a>:              Set maximum polling interval for a source
<li><a href="#maxupdateskew-command">maxupdateskew command</a>:        Set safety threshold for clock gain/loss rate
<li><a href="#minpoll-command">minpoll command</a>:              Set minimum polling interval for a source
<li><a href="#offline-command">offline command</a>:              Warn that connectivity to a source will be lost
<li><a href="#online-command">online command</a>:               Warn that connectivity to a source has been restored
<li><a href="#password-command">password command</a>:             Provide password needed for most commands
<li><a href="#quit-command">quit command</a>:                 Exit from chronyc
<li><a href="#rtcdata-command">rtcdata command</a>:              Display RTC parameters
<li><a href="#settime-command">settime command</a>:              Provide a manual input of the current time
<li><a href="#sources-command">sources command</a>:              Display information about the current set of sources
<li><a href="#sourcestats-command">sourcestats command</a>:          Display the rate &amp; offset estimation performance of sources
<li><a href="#tracking-command">tracking command</a>:             Display system clock performance
<li><a href="#trimrtc-command">trimrtc command</a>:              Correct the RTC time to the current system time
<li><a href="#writertc-command">writertc command</a>:             Write the RTC parameters to file. 
</ul>
<!-- }}} -->
<!-- {{{ accheck -->
<div class="node">
<p><hr>
<a name="accheck-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#activity-command">activity command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.1 accheck</h5>

<p>This command allows you to check whether client NTP access is allowed
from a particular host.

   <p>Examples of use, showing a named host and a numeric IP address, are as
follows:

<pre class="example">     accheck a.b.c
     accheck 1.2.3.4
</pre>
   <p>This command can be used to examine the effect of a series of
<code>allow</code>, <code>allow all</code>, <code>deny</code> and <code>deny all</code> commands
specified either via chronyc, or in <code>chronyd's</code> configuration file. 
<!-- }}} -->
<!-- {{{ activity command -->
<div class="node">
<p><hr>
<a name="activity-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#add-peer-command">add peer command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#accheck-command">accheck command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.2 activity</h5>

<p>This command reports the number of servers/peers that are online and offline. 
If the auto_offline option is used in specifying some of the servers/peers, the
<code>activity</code> command may be useful for detecting when all of them have
entered the offline state after the PPP link has been disconnected.

   <p>The report shows the number of servers/peers in 4 states:
     <ul>
<li><code>online</code> : the server/peer is currently online (i.e. assumed by
chronyd to be reachable)
<li><code>offline</code> : the server/peer is currently offline (i.e. assumed by
chronyd to be unreachable, and no measurements from it will be attempted.) 
<li><code>burst_online</code> : a burst command has been initiated for the
server/peer and is being performed; after the burst is complete, the
server/peer will be returned to the online state. 
<li><code>burst_offline</code> : a burst command has been initiated for the
server/peer and is being performed; after the burst is complete, the
server/peer will be returned to the offline state. 
</ul>
   <!-- }}} -->
<!-- {{{ add peer -->
<div class="node">
<p><hr>
<a name="add-peer-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#add-server-command">add server command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#activity-command">activity command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.3 add peer</h5>

<p>The <code>add peer</code> command allows a new NTP peer to be added whilst
<code>chronyd</code> is running.

   <p>Following the words <code>add peer</code>, the syntax of the following
parameters and options is identical to that for the <code>peer</code>
directive in the configuration file (see <a href="#peer-directive">peer directive</a>).

   <p>An example of using this command is shown below.

<pre class="example">     add peer foo.bar.com minpoll 6 maxpoll 10 authkey 25
</pre>
   <!-- }}} -->
<!-- {{{ add server -->
<div class="node">
<p><hr>
<a name="add-server-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#allow-command">allow command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#add-peer-command">add peer command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.4 add server</h5>

<p>The <code>add server</code> command allows a new NTP server to be added whilst
<code>chronyd</code> is running.

   <p>Following the words <code>add server</code>, the syntax of the following
parameters and options is identical to that for the <code>server</code>
directive in the configuration file (see <a href="#server-directive">server directive</a>).

   <p>An example of using this command is shown below.

<pre class="example">     add server foo.bar.com minpoll 6 maxpoll 10 authkey 25
</pre>
   <!-- }}} -->
<!-- {{{ allow -->
<div class="node">
<p><hr>
<a name="allow-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#allow-all-command">allow all command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#add-server-command">add server command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.5 allow</h5>

<p>The effect of the allow command is identical to the <code>allow</code> directive in
the configuration file (see <a href="#allow-directive">allow directive</a>).

   <p>The syntax is illustrated in the following examples:

<pre class="example">     allow foo.bar.com
     allow 1.2
     allow 3.4.5
     allow 6.7.8/22
     allow 6.7.8.9/22
     allow
</pre>
   <p>The effect of each of these examples is the same as that of the <code>allow</code>
directive in the configuration file. 
<!-- }}} -->
<!-- {{{ allow all -->
<div class="node">
<p><hr>
<a name="allow-all-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#burst-command">burst command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#allow-command">allow command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.6 allow all</h5>

<p>The effect of the allow command is identical to the <code>allow all</code>
directive in the configuration file (see <a href="#allow-directive">allow directive</a>). 
<!-- }}} -->
<!-- {{{ burst -->
<div class="node">
<p><hr>
<a name="burst-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#clients-command">clients command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#allow-all-command">allow all command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.7 burst</h5>

<p>The <code>burst</code> command tells <code>chronyd</code> to make a set of measurements to
each of its sources over a short duration (rather than the usual
periodic measurements that it makes).  After such a burst, <code>chronyd</code> will
revert to the previous state for each source.  This might be either
online, if the source was being periodically measured in the normal way,
or offline, if the source had been indicated as being offline. 
(Switching a source between the online and offline states is described
in <a href="#online-command">online command</a>, <a href="#offline-command">offline command</a>).

   <p>The syntax of the burst command is as follows

<pre class="example">     burst &lt;n-good-measurements&gt;/&lt;max-measurements&gt; [&lt;mask&gt;/&lt;masked-address&gt;]
</pre>
   <p>The mask and masked-address arguments are optional, in which case
<code>chronyd</code> will initiate a burst for all of its currently defined sources.

   <p>The arguments have the following meaning and format.

     <dl>
<dt><code>n-good-measurements</code><dd>This defines the number of good measurements that <code>chronyd</code> will want to
obtain from each source.  A measurement is good if it passes certain
tests, for example, the round trip time to the source must be
acceptable.  (This allows <code>chronyd</code> to reject measurements that are likely
to be bogus.)

     <br><dt><code>max-measurements</code><dd>This defines the maximum number of measurements that <code>chronyd</code> will
attempt to make, even if the required number of good measurements has
not been obtained.

     <br><dt><code>mask</code><dd>This is a dotted quad argument (e.g. <code>255.255.255.0</code>) with which
the IP address of each of <code>chronyd</code>'s sources is to be masked.

     <br><dt><code>masked-address</code><dd>This is a dotted quad argument (e.g. <code>1.2.3.0</code>).  If the masked IP
address of a source matches this value then the burst command is applied
to that source. 
</dl>

   <p>If no mask or masked address arguments are provided, the default is
<code>0.0.0.0</code> and <code>0.0.0.0</code> respectively, which will match every
source.

   <p>An example of the two-argument form of the command is

<pre class="example">     burst 2/10
</pre>
   <p>This will cause <code>chronyd</code> to attempt to get two good measurements from
each source, stopping after two have been obtained, but in no event will
it try more than ten probes to the source.

   <p>An example of the four-argument form of the command is

<pre class="example">     burst 2/10 255.255.0.0/1.2.0.0
</pre>
   <p>In this case, the two out of ten sampling will only be applied to
sources whose IP addresses are of the form <code>1.2.x.y</code>, where x and y
are arbitrary. 
<!-- }}} -->
<!-- {{{ clients -->
<div class="node">
<p><hr>
<a name="clients-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmdaccheck-command">cmdaccheck command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#burst-command">burst command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<!-- node-name,  next,  previous,  up -->
<h5 class="subsubsection">4.3.4.8 clients</h5>

<p>This command shows a list of all clients that have accessed the server,
through either the NTP or command/monitoring ports.  There are no arguments.

   <p>An example of the output is

<pre class="example">     Hostname                   Client    Peer CmdAuth CmdNorm  CmdBad  LstN  LstC
     =========================  ======  ======  ======  ======  ======  ====  ====
     localhost                       0       0      15       1       0   29y     0
     aardvark.xxx                    4       0       0       0       0    49   29y
     badger.xxx                      4       0       0       0       0     6   29y
</pre>
   <p>Each row shows the data for a single host.  Only hosts that have passed
the host access checks (set with the <code>allow</code>, <code>deny</code>,
<code>cmdallow</code> and <code>cmddeny</code> commands or configuration file
directives) are logged.

   <p>The columns are as follows:

     <ol type=1 start=1>
<li>The hostname of the client
<li>The number of times the client has accessed the server using an NTP
client mode packet. 
<li>The number of times the client has accessed the server using an NTP
symmetric active mode packet. 
<li>The number of authenticated command packets that have been processed
from the client (i.e. those following a successful <code>password</code>
command). 
<li>The number of unauthenticated command packets that have been processed
from the client. 
<li>The number of bad command packets received from the client (not all
forms of bad packet are logged). 
<li>Time since the last NTP packet was received
<li>Time since the last command packet was received
        </ol>

   <p>The last two entries will be shown as the time since 1970 if no packet
of that type has ever been received. 
<!-- }}} -->
<!-- {{{ cmdaccheck -->
<div class="node">
<p><hr>
<a name="cmdaccheck-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmdallow-command">cmdallow command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#clients-command">clients command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.9 cmdaccheck</h5>

<p>This command is similar to the <code>accheck</code> command, except that it is
used to check whether command access is permitted from a named host.

   <p>Examples of use are as follows:

<pre class="example">     cmdaccheck a.b.c
     cmdaccheck 1.2.3.4
</pre>
   <!-- }}} -->
<!-- {{{ cmdallow -->
<div class="node">
<p><hr>
<a name="cmdallow-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmdallow-all-command">cmdallow all command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmdaccheck-command">cmdaccheck command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.10 cmdallow</h5>

<p>This is similar to the <code>allow</code> command, except that it is used to
allow particular hosts or subnets to use the chronyc program to interact
with <code>chronyd</code> on the current host. 
<!-- }}} -->
<!-- {{{ cmdallow all -->
<div class="node">
<p><hr>
<a name="cmdallow-all-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmddeny-command">cmddeny command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmdallow-command">cmdallow command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.11 cmdallow all</h5>

<p>This is similar to the <code>allow all</code> command, except that it is used to<!-- {{{ -->
allow particular hosts or subnets to use the chronyc program to interact<!-- }}} -->
with <code>chronyd</code> on the current host. 
<!-- }}} -->
<!-- {{{ cmddeny -->
<div class="node">
<p><hr>
<a name="cmddeny-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cmddeny-all-command">cmddeny all command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmdallow-all-command">cmdallow all command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.12 cmddeny</h5>

<p>This is similar to the <code>deny</code> command, except that it is used to
allow particular hosts or subnets to use the chronyc program to interact
with <code>chronyd</code> on the current host. 
<!-- }}} -->
<!-- {{{ cmddeny all -->
<div class="node">
<p><hr>
<a name="cmddeny-all-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#cyclelogs-command">cyclelogs command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmddeny-command">cmddeny command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.13 cmddeny all</h5>

<p>This is similar to the <code>deny all</code> command, except that it is used
to allow particular hosts or subnets to use the chronyc program to
interact with <code>chronyd</code> on the current host. 
<!-- }}} -->
<!-- {{{ cyclelogs -->
<div class="node">
<p><hr>
<a name="cyclelogs-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#delete-command">delete command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmddeny-all-command">cmddeny all command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.14 cyclelogs</h5>

<p>The <code>cyclelogs</code> command causes all of <code>chronyd's</code> open log files to
be closed and re-opened.  This allows them to be renamed so that they can be
periodically purged.  An example of how to do this is shown below.

<pre class="example">     % mv /var/log/chrony/measurements.log /var/log/chrony/measurements1.log
     % chronyc
     chronyc&gt; password aardvark
     200 OK
     chronyc&gt; cyclelogs
     200 OK
     chronyc&gt; exit
     % ls -l /var/log/chrony
     -rw-r--r--   1 root     root            0 Jun  8 18:17 measurements.log
     -rw-r--r--   1 root     root        12345 Jun  8 18:17 measurements1.log
     % rm -f measurements1.log
</pre>
   <!-- }}} -->
<!-- {{{ delete -->
<div class="node">
<p><hr>
<a name="delete-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#deny-command">deny command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cyclelogs-command">cyclelogs command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.15 delete</h5>

<p>The <code>delete</code> command allows an NTP server or peer to be removed
from the current set of sources.

   <p>The syntax is illustrated in the examples below.

<pre class="example">     delete foo.bar.com
     delete 1.2.3.4
</pre>
   <p>There is one parameter, the name or IP address of the server or peer to
be deleted. 
<!-- }}} -->
<!-- {{{ deny -->
<div class="node">
<p><hr>
<a name="deny-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#deny-all-command">deny all command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#delete-command">delete command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.16 deny</h5>

<p>The effect of the allow command is identical to the <code>deny</code>
directive in the configuration file (see <a href="#deny-directive">deny directive</a>).

   <p>The syntax is illustrated in the following examples:

<pre class="example">     deny foo.bar.com
     deny 1.2
     deny 3.4.5
     deny 6.7.8/22
     deny 6.7.8.9/22
     deny
</pre>
   <!-- }}} -->
<!-- {{{ deny all -->
<div class="node">
<p><hr>
<a name="deny-all-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#dump-command">dump command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#deny-command">deny command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.17 deny all</h5>

<p>The effect of the allow command is identical to the <code>deny all</code>
directive in the configuration file (see <a href="#deny-directive">deny directive</a>). 
<!-- }}} -->
<!-- {{{ dump -->
<div class="node">
<p><hr>
<a name="dump-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#exit-command">exit command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#deny-all-command">deny all command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.18 dump</h5>

<p>The <code>dump</code> command causes <code>chronyd</code> to write its current history of
measurements for each of its sources to dump files, either for
inspection or to support the <code>-r</code> option when <code>chronyd</code> is restarted.

   <p>The <code>dump</code> command is somewhat equivalent to the <code>dumponexit</code>
directive in the chrony configuration file.  See <a href="#dumponexit-directive">dumponexit directive</a>.

   <p>To use the <code>dump</code>, you probably want to configure the name of the
directory into which the dump files will be written.  This can only be
done in the configuration file, see <a href="#dumpdir-directive">dumpdir directive</a>. 
<!-- }}} -->
<!-- {{{ exit -->
<div class="node">
<p><hr>
<a name="exit-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#help-command">help command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dump-command">dump command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.19 exit</h5>

<p>The exit command exits from chronyc and returns the user to the shell
(same as the quit command). 
<!-- }}} -->
<!-- {{{ help -->
<div class="node">
<p><hr>
<a name="help-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#local-command">local command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#exit-command">exit command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.20 help</h5>

<p>The help command displays a summary of the commands and their arguments. 
<!-- }}} -->
<!-- {{{ local -->
<div class="node">
<p><hr>
<a name="local-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#makestep-command">makestep command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#help-command">help command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.21 local</h5>

<p>The <code>local</code> command allows <code>chronyd</code> to be told that it is to appear
as a reference source, even if it is not itself properly synchronised to
an external source.  (This can be used on isolated networks, to allow
one computer to be a master time server with the other computers slaving
to it.)  The <code>local</code> command is somewhat equivalent to the
<code>local</code> directive in the configuration file, see <a href="#local-directive">local directive</a>.

   <p>The syntax is as shown in the following examples.

<pre class="example">     local stratum 10
     local off
</pre>
   <p>The first example enables the local reference mode on the host, and sets
the stratum at which it should claim to be synchronised.

   <p>The second example disables the local reference mode. 
<!-- }}} -->
<!-- {{{ makestep -->
<div class="node">
<p><hr>
<a name="makestep-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#manual-command">manual command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#local-command">local command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.22 makestep</h5>

<p>Normally chronyd will cause the system to gradually correct any time
offset, by slowing down or speeding up the clock as required.  In
certain situations, the system clock may be so far adrift that this
slewing process would take a very long time to correct the system clock.

   <p>The <code>makestep</code> command can be used in this situation.  It cancels
any remaining correction that was being slewed, and jumps the system
clock by the equivalent amount, making it correct immediately.

   <p>BE WARNED - certain software will be seriously affected by such jumps to
the system time.  (That is the reason why chronyd uses slewing
normally.)

   <p>The <code>makestep</code> command is currently only available on the Linux
version of chrony. 
<!-- }}} -->
<!-- {{{ manual -->
<div class="node">
<p><hr>
<a name="manual-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#maxdelay-command">maxdelay command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#makestep-command">makestep command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.23 manual</h5>

<p>The manual command enables and disables use of the <code>settime</code>
command (see <a href="#settime-command">settime command</a>), and is used to modify the behaviour
of the manual clock driver.

   <p>Examples of the command are shown below.

<pre class="example">     manual on
     manual off
     manual delete 1
     manual list
     manual reset
</pre>
   <p>The <code>on</code> form of the command enables use of the <code>settime</code>
command.

   <p>The <code>off</code> form of the command disables use of the <code>settime</code>
command.

   <p>The <code>list</code> form of the command lists all the samples currently
stored in <code>chronyd</code>.  The output is illustrated below.

<pre class="example">     210 n_samples = 1
     #    Date  Time(UTC)    Slewed   Original   Residual
     ====================================================
      0 27Jan99 22:09:20       0.00       0.97       0.00
</pre>
   <p>The columns as as follows :

     <ol type=1 start=1>
<li>The sample index (used for the <code>manual delete</code> command)
<li>The date and time of the sample
<li>The system clock error when the timestamp was entered, adjusted to allow
for changes made to the system clock since. 
<li>The system clock error when the timestamp was entered, as it originally
was (without allowing for changes to the system clock since). 
<li>The regression residual at this point, in seconds.  This allows
'outliers' to be easily spotted, so that they can be deleted using the
<code>manual delete</code> command.
        </ol>

   <p>The <code>delete</code> form of the command deletes a single sample.  The
parameter is the index of the sample, as shown in the first column of
the output from <code>manual list</code>.  Following deletion of the data
point, the current error and drift rate are re-estimated from the
remaining data points and the system clock trimmed if necessary.  This
option is intended to allow 'outliers' to be discarded, i.e. samples
where the administrator realises he/she has entered a very poor
timestamp.

   <p>The <code>reset</code> form of the command deletes all samples at once.  The
system clock is left running as it was before the command was entered. 
<!-- }}} -->
<!-- {{{ maxdelay -->
<div class="node">
<p><hr>
<a name="maxdelay-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#maxdelayratio-command">maxdelayratio command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#manual-command">manual command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.24 maxdelay</h5>

<p>This allows the <code>maxdelay</code> option for one of the sources to be
modified, in the same way as specifying the <code>maxdelay</code> option for
the <code>server</code> directive in the configuration file (see <a href="#server-directive">server directive</a>).

   <p>The following examples illustrate the syntax

<pre class="example">     maxdelay foo.bar.com 0.3
     maxdelay 1.2.3.4 0.0015
</pre>
   <p>The first example sets the maximum network delay allowed for a
measurement to the host <code>foo.bar.com</code> to 0.3 seconds.  The second
example sets the maximum network delay for a measurement to the host
with IP address <code>1.2.3.4</code> to 1.5 milliseconds.

   <p>(Any measurement whose network delay exceeds the specified value is
discarded.) 
<!-- }}} -->
<!-- {{{ maxdelayratio -->
<div class="node">
<p><hr>
<a name="maxdelayratio-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#maxpoll-command">maxpoll command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#maxdelay-command">maxdelay command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.25 maxdelayratio</h5>

<p>This allows the <code>maxdelayratio</code> option for one of the sources to be
modified, in the same way as specifying the <code>maxdelayratio</code> option
for the <code>server</code> directive in the configuration file (see <a href="#server-directive">server directive</a>).

   <p>The following examples illustrate the syntax

<pre class="example">     maxdelayratio foo.bar.com 1.5
     maxdelayratio 1.2.3.4 2.0
</pre>
   <p>The first example sets the maximum network delay for a measurement to
the host <code>foo.bar.com</code> to be 1.5 times the minimum delay found
amongst the previous measurements that have been retained.  The second
example sets the maximum network delay for a measurement to the host
with IP address <code>1.2.3.4</code> to be double the retained minimum.

   <p>As for <code>maxdelay</code>, any measurement whose network delay is too large
will be discarded. 
<!-- }}} -->
<!-- {{{ maxpoll -->
<div class="node">
<p><hr>
<a name="maxpoll-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#maxupdateskew-command">maxupdateskew command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#maxdelayratio-command">maxdelayratio command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.26 maxpoll</h5>

<p>The <code>maxpoll</code> command is used to modify the minimum polling
interval for one of the current set of sources.  It is equivalent to the
<code>maxpoll</code> option in the <code>server</code> directive in the
configuration file (see <a href="#server-directive">server directive</a>).

   <p>The syntax is as follows

<pre class="example">     maxpoll &lt;host&gt; &lt;new-maxpoll&gt;
</pre>
   <p>where the host can be specified as either a machine name or dotted-quad
IP address.  The new minimum poll is specified as a base-2 logarithm of
the number of seconds between polls (e.g. specify 6 for 64 second
sampling).

   <p>An example is

<pre class="example">     maxpoll foo.bar.com 10
</pre>
   <p>which sets the maximum polling interval for the host <code>foo.bar.com</code>
to 1024 seconds.

   <p>Note that the new maximum polling interval only takes effect after the
next measurement has been made. 
<!-- }}} -->
<!-- {{{ maxupdateskew -->
<div class="node">
<p><hr>
<a name="maxupdateskew-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#minpoll-command">minpoll command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#maxpoll-command">maxpoll command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.27 maxupdateskew</h5>

<p>This command has the same effect as the <code>maxupdateskew</code> directive
in the configuration file, see <a href="#maxupdateskew-directive">maxupdateskew directive</a>. 
<!-- }}} -->
<!-- {{{ minpoll -->
<div class="node">
<p><hr>
<a name="minpoll-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#offline-command">offline command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#maxupdateskew-command">maxupdateskew command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.28 minpoll</h5>

<p>The <code>minpoll</code> command is used to modify the minimum polling
interval for one of the current set of sources.  It is equivalent to the
<code>minpoll</code> option in the <code>server</code> directive in the
configuration file (see <a href="#server-directive">server directive</a>).

   <p>The syntax is as follows

<pre class="example">     minpoll &lt;host&gt; &lt;new-minpoll&gt;
</pre>
   <p>where the host can be specified as either a machine name or dotted-quad
IP address.  The new minimum poll is specified as a base-2 logarithm of
the number of seconds between polls (e.g. specify 6 for 64 second
sampling).

   <p>An example is

<pre class="example">     minpoll foo.bar.com 5
</pre>
   <p>which sets the minimum polling interval for the host <code>foo.bar.com</code>
to 32 seconds.

   <p>Note that the new minimum polling interval only takes effect after the
next measurement has been made. 
<!-- }}} -->
<!-- {{{ offline -->
<div class="node">
<p><hr>
<a name="offline-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#online-command">online command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#minpoll-command">minpoll command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.29 offline</h5>

<p>The <code>offline</code> command is used to warn <code>chronyd</code> that the network
connection to a particular host or hosts is about to be lost.  It should
be used on computers with a dial-up or similar connection to their time
sources, to warn <code>chronyd</code> that the connection is about to be broken.

   <p>An example of how to use <code>offline</code> in this case is shown in
<a href="#Advising-chronyd-of-internet-availability">Advising chronyd of internet availability</a>.

   <p>Another case where <code>offline</code> could be used is where a computer
serves time to a local group of computers, and has a permanant
connection to true time servers outside the organisation.  However, the
external connection is heavily loaded at certain times of the day and
the measurements obtained are less reliable at those times.  In this
case, it is probably most useful to determine the gain/loss rate during
the quiet periods and let the whole network coast through the loaded
periods.  The <code>offline</code> and <code>online</code> commands can be used to
achieve this.  The situation is shown in the figure below.

<pre class="example">               +----------+
               |Ext source|
               +----------+
                   |
                   |
                   |/| &lt;-- Link with variable
                     |     reliability
                     |
           +-------------------+
           |Local master server|
           +-------------------+
                     |
       +---+---+-----+-----+----+----+
       |   |   |     |     |    |    |
                Local clients
</pre>
   <p>If the source to which <code>chronyd</code> is currently synchronised is indicated
offline in this way, <code>chronyd</code> will continue to treat it as the
synchronisation source.  If the network connection were broken without
the <code>offline</code> command being used, <code>chronyd</code> would assume that the
source had failed and would attempt to pick another synchronisation
source.

   <p>There are two forms of the <code>offline</code> command.  The first form is a
wildcard, meaning all sources.  The second form allows a IP address mask
and a masked address to be specified.  These forms are illustrated below.

<pre class="example">     offline
     offline 255.255.255.0/1.2.3.0
</pre>
   <p>The second form means that the <code>offline</code> command is to be applied
to any source whose IP address is in the 1.2.3 subnet.  (The host's
address is logically and-ed with the mask, and if the result matches the
masked-address the host is processed).

   <p>The wildcard form of the address is actually equivalent to

<pre class="example">     offline 0.0.0.0/0.0.0.0
</pre>
   <!-- }}} -->
<!-- {{{ online -->
<div class="node">
<p><hr>
<a name="online-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#password-command">password command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#offline-command">offline command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.30 online</h5>

<p>The <code>online</code> command is opposite in function to the <code>offline</code>
command.  It is used to advise <code>chronyd</code> that network connectivity to a
particular source or sources has been restored.

   <p>The syntax is identical to that of the <code>offline</code> command, see
<a href="#offline-command">offline command</a>. 
<!-- }}} -->
<!-- {{{ password -->
<div class="node">
<p><hr>
<a name="password-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#quit-command">quit command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#online-command">online command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.31 password</h5>

<p>The password command is used to allow chronyc to send privileged
commands to <code>chronyd</code>.  The password can either be entered on the command
line, or can be entered without echoing.  The syntax for entering the
password on the command line is as follows

<pre class="example">     password xyzzy
</pre>
   <p>To enter the password without it being echoed, enter

<pre class="example">     password
</pre>
   <p>The computer will respond with a <span class="samp">Password:</span> prompt, at which you
should enter the password and press return.  (Note that the no-echo mode
is limited to 8 characters on SunOS 4.1 due to limitations in the system
library.  Other systems do not have this restriction.)

   <p>The password is any string of characters not containing whitespace.  It
has to match <code>chronyd's</code> currently defined command key (see <a href="#commandkey-directive">commandkey directive</a>). 
<!-- }}} -->
<!-- {{{ quit -->
<div class="node">
<p><hr>
<a name="quit-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#rtcdata-command">rtcdata command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#password-command">password command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.32 quit</h5>

<p>The quit command exits from chronyc and returns the user to the shell
(same as the exit command). 
<!-- }}} -->
<!-- {{{ rtcdata -->
<div class="node">
<p><hr>
<a name="rtcdata-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#settime-command">settime command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#quit-command">quit command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.33 rtcdata</h5>

<p>The <code>rtcdata</code> command displays the current real time clock RTC parameters.

   <p>An example output is shown below.

<pre class="example">     RTC ref time (GMT) : Sat May 30 07:25:56 1998
     Number of samples  : 10
     Number of runs     : 5
     Sample span period :  549
     RTC is fast by     :    -1.632736 seconds
     RTC gains time at  :  -107.623 ppm
</pre>
   <p>The fields have the following meaning

     <dl>
<dt><code>RTC ref time (GMT)</code><dd>This is the RTC reading the last time its error was measured. 
<br><dt><code>Number of samples</code><dd>This is the number of previous measurements being used to determine the
RTC gain/loss rate. 
<br><dt><code>Number of runs</code><dd>This is the number of runs of residuals of the same sign following the
regression fit for (RTC error) versus (RTC time).  A value which is
small indicates that the measurements are not well approximated by a
linear model, and that the algorithm will tend to delete the older
measurements to improve the fit. 
<br><dt><code>Sample span period</code><dd>This is the period that the measurements span (from the oldest to the
newest).  Without a unit the value is in seconds; suffixes `m' for
minutes, `h' for hours, `d' for days or `y' for years may be used. 
<br><dt><code>RTC is fast by</code><dd>This is the estimate of how many seconds fast the RTC when it thought
the time was at the reference time (above).  If this value is large, you
may (or may not) want to use the <code>trimrtc</code> command to bring the RTC
into line with the system clock.  (Note, a large error will not affect
<code>chronyd's</code> operation, unless it becomes so big as to start causing
rounding errors. 
<br><dt><code>RTC gains time at</code><dd>This is the amount of time gained (positive) or lost (negative) by the
real time clock for each second that it ticks.  It is measured in parts
per million.  So if the value shown was +1, suppose the RTC was exactly
right when it crosses a particular second boundary.  Then it would be 1
microsecond fast when it crosses its next second boundary. 
</dl>
   <!-- }}} -->
<!-- {{{ settime -->
<div class="node">
<p><hr>
<a name="settime-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sources-command">sources command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#rtcdata-command">rtcdata command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.34 settime</h5>

<p>The <code>settime</code> command allows the current time to be entered
manually, if this option has been configured into <code>chronyd</code>.  (It may be
configured either with the <code>manual</code> directive in the configuration
file (see <a href="#manual-directive">manual directive</a>), or with the <code>manual</code> command of
chronyc (see <a href="#manual-command">manual command</a>).

   <p>It should be noted that the computer's sense of time will only be as
accurate as the reference you use for providing this input (e.g. your
watch), as well as how well you can time the press of the return key. 
When inputting time to an isolated network, I have a battery operated
alarm clock that is synchronised to the Rugby MSF time signal in the UK.

   <p>Providing your computer's time zone is set up properly, you will be able
to enter a local time (rather than UTC).

   <p>The response to a successful <code>settime</code> command indicates the amount
that the computer's clock was wrong.  It should be apparent from this if
you have entered the time wrongly, e.g. with the wrong time zone.

   <p>The rate of drift of the system clock is estimated by a regression
process using the entered measurement and all previous measurements
entered during the present run of <code>chronyd</code>.  However, the entered
measurement is used for adjusting the current clock offset (rather than
the estimated intercept from the regression, which is ignored). 
Contrast what happens with the <code>manual delete</code> command, where the
intercept is used to set the current offset (since there is no
measurement that has just been typed in in that case).

   <p>The time is parsed by the public domain <span class="file">getdate</span> algorithm. 
Consequently, you can only specify time to the nearest second.

   <p>Examples of inputs that are valid are shown below.

<pre class="example">     settime 16:30
     settime 16:30:05
     settime Nov 21, 1997 16:30:05
</pre>
   <p>For a full description of <code>getdate</code>, get hold of the getdate
documentation (bundled, for example, with the source for GNU tar). 
<!-- }}} -->
<!-- {{{ sources -->
<div class="node">
<p><hr>
<a name="sources-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sourcestats-command">sourcestats command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#settime-command">settime command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.35 sources</h5>

<p>This command displays information about the current time sources that
<code>chronyd</code> is accessing.

   <p>The optional argument <code>-v</code> can be specified, meaning <em>verbose</em>.  In
this case, extra caption lines are shown as a reminder of the meanings of the
columns.

<pre class="example">     210 Number of sources = 3
     MS Name/IP address      Stratum Poll LastRx Last sample
     =======================================================================
     ^+ a.b.c                    3     6    47m  -9491us[-6983us] +/-  159ms
     ^+ d.e.f                    3     6    47m    +32ms[  +35ms] +/-  274ms
     ^* g.h.i                    2     6    47m  +8839us[  +11ms] +/-  214ms
</pre>
   <p>The columns are as follows:

     <dl>
<dt><code>M</code><dd>This indicates the mode of the source.  <code>^</code> means a server,
<code>=</code> means a peer and <code>#</code> indicates a locally connected
reference clock<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>.

     <br><dt><code>S</code><dd>This column indicates the state of the sources.  <code>*</code> indicates the
source to which <code>chronyd</code> is current synchronised.  <code>+</code> indicates
other acceptable sources.  <code>?</code> indicates sources to which
connectivity has been lost.  <code>x</code> indicates a clock which <code>chronyd</code>
thinks is is a falseticker (i.e. its time is inconsistent with a
majority of other sources).  <code>~</code> indicates a source whose time
appears to have too much variability.  The <code>~</code> condition is also
shown at start-up, until at least 3 samples have been gathered from it.

     <br><dt><code>Name/IP address</code><dd>This shows the name or the IP address of the source.

     <br><dt><code>Stratum</code><dd>This shows the stratum of the source, as reported in its most recently
received sample.  Stratum 1 indicates a computer with a locally attached
reference clock.  A computer that is synchronised to a stratum 1
computer is at stratum 2.  A computer that is synchronised to a stratum
2 computer is at stratum 3, and so on.

     <br><dt><code>Poll</code><dd>This shows the rate at which the source is being polled, as a base-2
logarithm of the interval in seconds.  Thus, a value of 6 would indicate
that a measurement is being made every 64 seconds.

     <p><code>chronyd</code> automatically varies the polling rate in response to prevailing
conditions.

     <br><dt><code>LastRx</code><dd>This column shows how long ago the last sample was received from the
source.  This is normally in seconds.  The letters <code>m</code>, <code>h</code>,
<code>d</code> or <code>y</code> indicate minutes, hours, days or years.

     <br><dt><code>Last sample</code><dd>This column shows the offset between the local clock and the source at
the last measurement.  The number in the square brackets shows the
actual measured offset.  This may be suffixed by <code>us</code> (indicating
microseconds), <code>ms</code> (indicating milliseconds), or <code>s</code>
(indicating seconds).  The number to the left of the square brackets
shows the original measurement, adjusted to allow for any slews applied
to the local clock since.  The number following the <code>+/-</code> indicator
shows the margin of error in the measurement.

     <p>Positive offsets indicate that the local clock is fast of the source.

   </dl>
   <!-- }}} -->
<!-- {{{ sourcestats -->
<div class="node">
<p><hr>
<a name="sourcestats-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#tracking-command">tracking command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#sources-command">sources command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.36 sourcestats</h5>

<p>The <code>sourcestats</code> command displays information about the drift rate
and offset estimatation process for each of the sources currently being
examined by <code>chronyd</code>.

   <p>The optional argument <code>-v</code> can be specified, meaning <em>verbose</em>.  In
this case, extra caption lines are shown as a reminder of the meanings of the
columns.

   <p>An example report is

<pre class="example">     210 Number of sources = 1
     Name/IP Address            NP  NR  Span  Frequency   Freq Skew   Std Dev
     ========================================================================
     abc.def.ghi                11   5   46m      -0.001       0.045     25us
</pre>
   <p>The columns are as follows

     <dl>
<dt><code>Name/IP Address</code><dd>This is the name or dotted-quad IP address of the NTP server (or peer)
to which the rest of the line relates.

     <br><dt><code>NP</code><dd>This is the number of sample points currently being retained for the
server.  The drift rate and current offset are estimated by performing a
linear regression through these points.

     <br><dt><code>NR</code><dd>This is the number of runs of residuals having the same sign following
the last regression.  If this number starts to become too small relative
to the number of samples, it indicates that a straight line is no longer
a good fit to the data.  If the number of runs is too low,
<code>chronyd</code> discards older samples and re-runs the regression until
the number of runs becomes acceptable.

     <br><dt><code>Span</code><dd>This is the interval between the oldest and newest samples.  If no unit
is shown the value is in seconds.  In the example, the interval is 46
minutes.

     <br><dt><code>Frequency</code><dd>This is the estimated residual frequency for the server, in parts per
million.  In this case, the computer's clock is estimated to be running
1 part in 10**9 slow relative to the server.

     <br><dt><code>Freq Skew</code><dd>This is the estimated error bounds on <code>Freq</code> (again in parts per
million).

     <br><dt><code>Std Dev</code><dd>This is the estimated sample standard deviation.

   </dl>
   <!-- }}} -->
<!-- {{{ tracking -->
<div class="node">
<p><hr>
<a name="tracking-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#trimrtc-command">trimrtc command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#sourcestats-command">sourcestats command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.37 tracking</h5>

<p>The <code>tracking</code> command displays parameters about the system's clock
performance.  An example of the output is shown below.

<pre class="example">     Reference ID    : 1.2.3.4 (a.b.c)
     Stratum         : 3
     Ref time (UTC)  : Sun May 17 06:13:11 1998
     System time     : 0.000000 seconds fast of NTP time
     Frequency       : 331.898 ppm fast
     Residual freq   : 0.004 ppm
     Skew            : 0.154 ppm
     Root delay      : 0.373169 seconds
     Root dispersion : 0.024780 seconds
</pre>
   <p>The fields are explained as follows.

     <dl>
<dt><code>Reference ID</code><dd>This is the IP address, and name if available, of the server to which
the computer is currently synchronised.  If this is <code>127.127.1.1</code>
it means the computer is not synchronised to any external source and
that you have the `local' mode operating (via the <code>local</code> command
in <code>chronyc</code> (see <a href="#local-command">local command</a>), or the <code>local</code> directive
in the <span class="file">/etc/chrony.conf</span> file (see <a href="#local-directive">local directive</a>)).

     <br><dt><code>Stratum</code><dd>The stratum indicates how many hops away from a computer with an
attached reference clock we are.  Such a computer is a stratum-1
computer, so the computer in the example is two hops away
(i.e. <code>a.b.c</code> is a stratum-2 and is synchronised from a stratum-1).

     <br><dt><code>Ref time</code><dd>This is the time (GMT) at which the last measurement from the reference
source was processed.

     <br><dt><code>System time</code><dd>In normal operation, <code>chronyd</code> <em>never</em> steps the system clock,
because any jump in the timescale can have adverse consequences for
certain application programs.  Instead, any error in the system clock is
corrected by slightly speeding up or slowing down the system clock until
the error has been removed, and then returning to the system clock's
normal speed.  A consequence of this is that there will be a period when
the system clock (as read by other programs using the
<code>gettimeofday()</code> system call, or by the <code>date</code> command in the
shell) will be different from <code>chronyd's</code> estimate of the current
true time (which it reports to NTP clients when it is operating in
server mode).  The value reported on this line is the difference due to
this effect.

     <p>On systems such as Solaris and SunOS, <code>chronyd</code> has no means to
adjust the fundamental rate of the system clock, so keeps the system
time correct by periodically making offsets to it as though an error had
been measured.  The build up of these offsets will be observed in this
report.  On systems such as Linux where <code>chronyd</code> can adjust the
fundamental rate of the system clock, this value will show zero unless a
very recent measurement has shown the system to be error.

     <br><dt><code>Frequency</code><dd>The `frequency' is the rate by which the system's clock would be would
be wrong if <code>chronyd</code> was not correcting it.  It is expressed in
ppm (parts per million).  For example, a value of 1ppm would mean that
when the system's clock thinks it has advanced 1 second, it has actually
advanced by 1.000001 seconds relative to true time.

     <p>As you can see in the example, the clock in the computer I developed
<code>chrony</code> on is not a very good one - it gains about 30 seconds per
day!  This was the reason I started to write <code>chrony</code> in the first
place.

     <br><dt><code>Residual freq</code><dd>This shows the `residual frequency' for the currently selected reference
source.  This reflects any difference between what the measurements from
the reference source indicate the frequency should be and the frequency
currently being used.

     <p>The reason this is not always zero is that a smoothing procedure is
applied to the frequency.  Each time a measurement from the reference
source is obtained and a new residual frequency computed, the estimated
accuracy of this residual is compared with the estimated accuracy (see
`skew' next) of the existing frequency value.  A weighted average is
computed for the new frequency, with weights depending on these
accuracies.  If the measurements from the reference source follow a
consistent trend, the residual will be driven to zero over time.

     <br><dt><code>Skew</code><dd>This is the estimated error bound on the the frequency.

     <br><dt><code>Root delay</code><dd>This is the total of the network path delays to the stratum-1 computer
from which the computer is ultimately synchronised.

     <p>In certain extreme situations, this value can be negative.  (This can
arise in a symmetric peer arrangement where the computers' frequencies
are not tracking each other and the network delay is very short relative
to the turn-around time at each computer.)

     <br><dt><code>Root dispersion</code><dd>This is the total dispersion accumulated through all the computers back
to the stratum-1 computer from which the computer is ultimately
synchronised.  Dispersion is due to system clock resolution, statistical
measurement variations etc.

     <p>An absolute bound on the computer's clock accuracy (assuming the
stratum-1 computer is correct) is given by

     <pre class="example">          clock_error &lt;= root_dispersion + (0.5 * |root_delay|)
     </pre>
     </dl>
   <!-- }}} -->
<!-- {{{ trimrtc -->
<div class="node">
<p><hr>
<a name="trimrtc-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#writertc-command">writertc command</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#tracking-command">tracking command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.38 trimrtc</h5>

<p>The <code>trimrtc</code> command is used to correct the system's real time
clock (RTC) to the main system clock.  It has no effect if the error
between the two clocks is currently estimated at less than a second (the
resolution of the RTC is only 1 second).

   <p>The command takes no arguments.  It performs the following steps (if the
RTC is more than 1 second away from the system clock):

     <ol type=1 start=1>
<li>Remember the currently estimated gain/loss rate of the RTC and flush the
previous measurements. 
<li>Step the real time clock to bring it within a second of the system clock. 
<li>Make several measurements to accurately determine the new offset between
the RTC and the system clock (i.e. the remaining fraction of a second
error)
<li>Save the RTC parameters to the RTC file (specified with the
<code>rtcfile</code> directive in the configuration file (see <a href="#rtcfile-directive">rtcfile directive</a>).
        </ol>

   <p>The last step is done as a precaution against the computer suffering a
power failure before either the daemon exits or the <code>writertc</code>
command is issued.

   <p><code>chronyd</code> will still work perfectly well both whilst operating and
across machine reboots even if the <code>trimrtc</code> command is never used
(and the RTC is allowed to drift away from true time).  The
<code>trimrtc</code> command is provided as a method by which it can be
corrected, in a manner compatible with <code>chronyd</code> using it to
maintain accurate time across machine reboots. 
<!-- }}} -->
<!-- {{{ writertc -->
<div class="node">
<p><hr>
<a name="writertc-command"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#trimrtc-command">trimrtc command</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Chronyc-command-reference">Chronyc command reference</a>
<br>
</div>

<h5 class="subsubsection">4.3.4.39 writertc</h5>

<p>The <code>writertc</code> command writes the currently estimated error and
gain/loss rate parameters for the RTC to the RTC file (specified with
the <code>rtcfile</code> directive (see <a href="#rtcfile-directive">rtcfile directive</a>)).  This
information is also written automatically when <code>chronyd</code> is killed
(with SIGHUP, SIGINT, SIGQUIT or SIGTERM). 
<!-- }}} -->
<!-- }}} -->
<!-- }}} -->
<!-- }}} -->
<!-- {{{ apx: porting guide -->
<div class="node">
<p><hr>
<a name="Porting-guide"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#GPL">GPL</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Usage-reference">Usage reference</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="appendix">Appendix A Porting guide</h2>

<!-- {{{ section top -->
<p>This appendix discusses issues that have arisen in writing the
system-specific parts of the existing ports.  This will provide useful
information for those attempting to write ports to other systems.

<ul class="menu">
<li><a accesskey="1" href="#System-driver-files">System driver files</a>:          What needs to go in a driver file for a
                                particular type of system
<li><a accesskey="2" href="#Quirks-of-particular-systems">Quirks of particular systems</a>:   Problem areas that have been found on ports
                                already written. 
</ul>
<!-- }}} -->
<!-- {{{ S:system driver files -->
<div class="node">
<p><hr>
<a name="System-driver-files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Quirks-of-particular-systems">Quirks of particular systems</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Porting-guide">Porting guide</a>
<br>
</div>

<h3 class="section">A.1 System driver files</h3>

<p>The system specific parts of the software are contained in files with
names like <code>sys_linux.c</code>.

   <p>The following functions are required in a system driver file:

     <ol type=1 start=1>
<li>A function to read the current frequency
<li>A function to set the current frequency
<li>A function to slew the system time by a specified delta
<li>A function to step the system time by a specified delta
<li>A function to work out the error at a particular time between the
system's clock and <code>chronyd's</code> estimate of real time.  (This is required
because some systems have to track real time by making the system time
follow it in a 'sawtooth' fashion).
        </ol>

   <p>The <dfn>frequency</dfn> is the rate at which the system gains or loses time,
measured relative to the system when running uncompensated. 
<!-- }}} -->
<!-- {{{ system quirks -->
<div class="node">
<p><hr>
<a name="Quirks-of-particular-systems"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#System-driver-files">System driver files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Porting-guide">Porting guide</a>
<br>
</div>

<h3 class="section">A.2 Quirks of particular systems</h3>

<!-- {{{ section top -->
<p>These sections describe quirks in each system type that needed to be
investigated to port the software to each system type.

<ul class="menu">
<li><a accesskey="1" href="#Linux-porting-quirks">Linux porting quirks</a>
<li><a accesskey="2" href="#Solaris-2_002e5-porting-quirks">Solaris 2.5 porting quirks</a>
<li><a accesskey="3" href="#SunOS-4_002e1_002e4-porting-quirks">SunOS 4.1.4 porting quirks</a>
</ul>
<!-- }}} -->
<!-- {{{ linux -->
<div class="node">
<p><hr>
<a name="Linux-porting-quirks"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Solaris-2_002e5-porting-quirks">Solaris 2.5 porting quirks</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Quirks-of-particular-systems">Quirks of particular systems</a>
<br>
</div>

<h4 class="subsection">A.2.1 Linux</h4>

<p>The following quirks have been found in developing the Linux port.

     <ol type=1 start=1>
<li>In order to avoid floating point arithmetic, the kernel uses shifting
and adding to approximate a scaling of 100/128.  This approximation
implies that the frequency set via the <code>adjtimex()</code> system call is
not the frequency that is actually obtained.  The method of
approximation varies between kernel versions and must be determined by
examining the kernel source.  An inverse factor must be included in the
driver to compensate. 
<li>In some kernel versions, an <code>adjtimex()</code> system call with the flags
bits all zeroed will return the amount of offset still to be corrected. 
In others (e.g. the 2.0 series beyond 2.0.32), the offset must be
changed in order to get the old offset returned (similar to
<code>adjtime()</code> on other systems).

        </ol>
<!-- }}} -->
<!-- {{{ solaris 2.5 -->
<div class="node">
<p><hr>
<a name="Solaris-2_002e5-porting-quirks"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#SunOS-4_002e1_002e4-porting-quirks">SunOS 4.1.4 porting quirks</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Linux-porting-quirks">Linux porting quirks</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Quirks-of-particular-systems">Quirks of particular systems</a>
<br>
</div>

<h4 class="subsection">A.2.2 Solaris 2.5</h4>

<p>The following quirks have been found in developing the Solaris port.

     <ol type=1 start=1>
<li>The <code>adjtime()</code> system call with a zero argument does not cancel an
adjustment that is in progress - it just reports the remaining
adjustment. 
<li>The <code>settimeofday()</code> system call only observes the seconds part of
the argument - any fractional seconds part is lost. 
second. 
<li>The kernel variable <code>dosynctodr</code> has to be set to zero, otherwise
the system clock is periodically reset to the real-time clock.
        </ol>
<!-- }}} -->
<!-- {{{ sunos 4.1.4 -->
<div class="node">
<p><hr>
<a name="SunOS-4_002e1_002e4-porting-quirks"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Solaris-2_002e5-porting-quirks">Solaris 2.5 porting quirks</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Quirks-of-particular-systems">Quirks of particular systems</a>
<br>
</div>

<h4 class="subsection">A.2.3 SunOS 4.1.4</h4>

<p>The following quirks have been found in developing the SunOS port.

     <ol type=1 start=1>
<li>The <code>adjtime()</code> system call truncates its argument to a multiple of
the system's <code>tickadj</code> variable.  (<code>chronyd</code> sets that to 100,
giving a 1 part in 100 slewing capability for correcting offsets.) 
<li>The kernel variable <code>dosynctodr</code> has to be set to zero, otherwise
the system clock is periodically reset to the real-time clock.
        </ol>
<!-- }}} -->
<!-- }}} -->
<!-- }}} -->
<!-- {{{ apx:GNU General Public License -->
<div class="node">
<p><hr>
<a name="GPL"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Porting-guide">Porting guide</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="appendix">Appendix B GNU General Public License</h2>

<div align="center">GNU GENERAL PUBLIC LICENSE</div>
<div align="center">Version 2, June 1991</div>

   <p>Copyright (C) 1989, 1991 Free Software Foundation, Inc. 
 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

   <p>			    Preamble

   <p>The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software&ndash;to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

   <p>When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

   <p>To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights. 
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

   <p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

   <p>We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

   <p>Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

   <p>Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

   <p>The precise terms and conditions for copying, distribution and
modification follow.

   <p>		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

   <p>0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

   <p>Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program). 
Whether that is true depends on what the Program does.

   <p>1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

   <p>You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

   <p>2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

   <p>a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

   <p>b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

   <p>c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

   <p>These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

   <p>Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

   <p>In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

   <p>3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

   <p>a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

   <p>b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

   <p>c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

   <p>The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

   <p>If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

   <p>4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License. 
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

   <p>5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

   <p>6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. 
You are not responsible for enforcing compliance by third parties to
this License.

   <p>7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

   <p>If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

   <p>It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

   <p>This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

   <p>8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

   <p>9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

   <p>Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

   <p>10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

   <p>			    NO WARRANTY

   <p>11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

   <p>12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

   <p>		     END OF TERMS AND CONDITIONS

   <p>	Appendix: How to Apply These Terms to Your New Programs

   <p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

   <p>To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

   <p>&lt;one line to give the program's name and a brief idea of what it does.&gt;
    Copyright (C) 19yy  &lt;name of author&gt;

   <p>This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

   <p>This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

   <p>You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

   <p>Also add information on how to contact you by electronic and paper mail.

   <p>If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

   <p>Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

   <p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items&ndash;whatever suits your program.

   <p>You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

   <p>Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

   <p>&lt;signature of Ty Coon&gt;, 1 April 1989
  Ty Coon, President of Vice

   <p>This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License. 
<!-- }}} -->
   <div class="contents">
<h2>Table of Contents</h2>
<ul>
<li><a name="toc_Top" href="#Top">User guide for the chrony suite</a>
<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
<ul>
<li><a href="#Overview">1.1 Overview</a>
<li><a href="#Acknowledgements">1.2 Acknowledgements</a>
<li><a href="#Availability">1.3 Availability</a>
<ul>
<li><a href="#Getting-the-software">1.3.1 Getting the software</a>
<li><a href="#Platforms">1.3.2 Platforms</a>
</li></ul>
<li><a href="#Other-time-synchronisation-packages">1.4 Relationship to other software packages</a>
<ul>
<li><a href="#Comparison-with-xntpd">1.4.1 xntpd</a>
<li><a href="#Comparison-with-timed">1.4.2 timed</a>
</li></ul>
<li><a href="#Distribution-and-warranty">1.5 Distribution rights and (lack of) warranty</a>
<li><a href="#Bug-reporting">1.6 Bug reporting and suggestions</a>
<li><a href="#Contributing">1.7 Contributions</a>
</li></ul>
<li><a name="toc_Installation" href="#Installation">2 Installation</a>
<ul>
<li><a href="#readline-support">2.1 Support for the readline library</a>
<li><a href="#package-builders">2.2 Extra options for package builders</a>
</li></ul>
<li><a name="toc_Typical-scenarios" href="#Typical-scenarios">3 Typical operating scenarios</a>
<ul>
<li><a href="#Computers-on-the-net">3.1 Computers connected to the internet</a>
<li><a href="#Infrequent-connection">3.2 Infrequent connection to true NTP servers</a>
<ul>
<li><a href="#Configuration-for-infrequent-connections">3.2.1 Setting up the configuration file for infrequent connections</a>
<li><a href="#Advising-chronyd-of-internet-availability">3.2.2 How to tell chronyd when the internet link is available.</a>
</li></ul>
<li><a href="#Isolated-networks">3.3 Isolated networks</a>
<li><a href="#Dial_002dup-home-PCs">3.4 The home PC with a dial-up connection</a>
<ul>
<li><a href="#Dial_002dup-overview">3.4.1 Assumptions/how the software works</a>
<li><a href="#Dial_002dup-configuration">3.4.2 Typical configuration files.</a>
</li></ul>
<li><a href="#Configuration-options-overview">3.5 Other important configuration options</a>
</li></ul>
<li><a name="toc_Usage-reference" href="#Usage-reference">4 Usage reference</a>
<ul>
<li><a href="#Starting-chronyd">4.1 Starting chronyd</a>
<li><a href="#Configuration-file">4.2 The chronyd configuration file</a>
<ul>
<li><a href="#comments-in-config-file">4.2.1 Comments in the configuration file</a>
<li><a href="#acquisitionport-directive">4.2.2 acquisitionport</a>
<li><a href="#allow-directive">4.2.3 allow</a>
<li><a href="#bindaddress-directive">4.2.4 bindaddress</a>
<li><a href="#bindcmdaddress-directive">4.2.5 bindcmdaddress</a>
<li><a href="#broadcast-directive">4.2.6 broadcast</a>
<li><a href="#cmdallow-directive">4.2.7 cmdallow</a>
<li><a href="#cmddeny-directive">4.2.8 cmddeny</a>
<li><a href="#commandkey-directive">4.2.9 commandkey</a>
<li><a href="#cmdport-directive">4.2.10 cmdport</a>
<li><a href="#deny-directive">4.2.11 deny</a>
<li><a href="#driftfile-directive">4.2.12 driftfile</a>
<li><a href="#dumpdir-directive">4.2.13 dumpdir</a>
<li><a href="#dumponexit-directive">4.2.14 dumponexit</a>
<li><a href="#initstepslew-directive">4.2.15 initstepslew</a>
<li><a href="#keyfile-directive">4.2.16 keyfile</a>
<li><a href="#local-directive">4.2.17 local</a>
<li><a href="#linux_005fhz-directive">4.2.18 linux_hz</a>
<li><a href="#linux_005ffreq_005fscale-directive">4.2.19 linux_freq_scale</a>
<li><a href="#log-directive">4.2.20 log</a>
<ul>
<li><a href="#measurements-log">4.2.20.1 Measurements log file format</a>
<li><a href="#statistics-log">4.2.20.2 Statistics log file format</a>
<li><a href="#tracking-log">4.2.20.3 Tracking log file format</a>
<li><a href="#RTC-log">4.2.20.4 Real-time clock log file format</a>
</li></ul>
<li><a href="#logchange-directive">4.2.21 logchange</a>
<li><a href="#logdir-directive">4.2.22 logdir</a>
<li><a href="#mailonchange-directive">4.2.23 mailonchange</a>
<li><a href="#manual-directive">4.2.24 manual</a>
<li><a href="#maxupdateskew-directive">4.2.25 maxupdateskew</a>
<li><a href="#noclientlog-directive">4.2.26 noclientlog</a>
<li><a href="#peer-directive">4.2.27 peer</a>
<li><a href="#pidfile-directive">4.2.28 pidfile</a>
<li><a href="#port-directive">4.2.29 port</a>
<li><a href="#rtcdevice-directive">4.2.30 rtcdevice</a>
<li><a href="#rtcfile-directive">4.2.31 rtcfile</a>
<li><a href="#rtconutc-directive">4.2.32 rtconutc</a>
<li><a href="#server-directive">4.2.33 server</a>
</li></ul>
<li><a href="#Running-chronyc">4.3 Running chronyc</a>
<ul>
<li><a href="#Chronyc-basic-use">4.3.1 Basic use</a>
<li><a href="#Chronyc-command-line-options">4.3.2 Command line options</a>
<li><a href="#Security-with-chronyc">4.3.3 Security with chronyc</a>
<li><a href="#Chronyc-command-reference">4.3.4 Command reference</a>
<ul>
<li><a href="#accheck-command">4.3.4.1 accheck</a>
<li><a href="#activity-command">4.3.4.2 activity</a>
<li><a href="#add-peer-command">4.3.4.3 add peer</a>
<li><a href="#add-server-command">4.3.4.4 add server</a>
<li><a href="#allow-command">4.3.4.5 allow</a>
<li><a href="#allow-all-command">4.3.4.6 allow all</a>
<li><a href="#burst-command">4.3.4.7 burst</a>
<li><a href="#clients-command">4.3.4.8 clients</a>
<li><a href="#cmdaccheck-command">4.3.4.9 cmdaccheck</a>
<li><a href="#cmdallow-command">4.3.4.10 cmdallow</a>
<li><a href="#cmdallow-all-command">4.3.4.11 cmdallow all</a>
<li><a href="#cmddeny-command">4.3.4.12 cmddeny</a>
<li><a href="#cmddeny-all-command">4.3.4.13 cmddeny all</a>
<li><a href="#cyclelogs-command">4.3.4.14 cyclelogs</a>
<li><a href="#delete-command">4.3.4.15 delete</a>
<li><a href="#deny-command">4.3.4.16 deny</a>
<li><a href="#deny-all-command">4.3.4.17 deny all</a>
<li><a href="#dump-command">4.3.4.18 dump</a>
<li><a href="#exit-command">4.3.4.19 exit</a>
<li><a href="#help-command">4.3.4.20 help</a>
<li><a href="#local-command">4.3.4.21 local</a>
<li><a href="#makestep-command">4.3.4.22 makestep</a>
<li><a href="#manual-command">4.3.4.23 manual</a>
<li><a href="#maxdelay-command">4.3.4.24 maxdelay</a>
<li><a href="#maxdelayratio-command">4.3.4.25 maxdelayratio</a>
<li><a href="#maxpoll-command">4.3.4.26 maxpoll</a>
<li><a href="#maxupdateskew-command">4.3.4.27 maxupdateskew</a>
<li><a href="#minpoll-command">4.3.4.28 minpoll</a>
<li><a href="#offline-command">4.3.4.29 offline</a>
<li><a href="#online-command">4.3.4.30 online</a>
<li><a href="#password-command">4.3.4.31 password</a>
<li><a href="#quit-command">4.3.4.32 quit</a>
<li><a href="#rtcdata-command">4.3.4.33 rtcdata</a>
<li><a href="#settime-command">4.3.4.34 settime</a>
<li><a href="#sources-command">4.3.4.35 sources</a>
<li><a href="#sourcestats-command">4.3.4.36 sourcestats</a>
<li><a href="#tracking-command">4.3.4.37 tracking</a>
<li><a href="#trimrtc-command">4.3.4.38 trimrtc</a>
<li><a href="#writertc-command">4.3.4.39 writertc</a>
</li></ul>
</li></ul>
</li></ul>
<li><a name="toc_Porting-guide" href="#Porting-guide">Appendix A Porting guide</a>
<ul>
<li><a href="#System-driver-files">A.1 System driver files</a>
<li><a href="#Quirks-of-particular-systems">A.2 Quirks of particular systems</a>
<ul>
<li><a href="#Linux-porting-quirks">A.2.1 Linux</a>
<li><a href="#Solaris-2_002e5-porting-quirks">A.2.2 Solaris 2.5</a>
<li><a href="#SunOS-4_002e1_002e4-porting-quirks">A.2.3 SunOS 4.1.4</a>
</li></ul>
</li></ul>
<li><a name="toc_GPL" href="#GPL">Appendix B GNU General Public License</a>
</li></ul>
</div>



   <div class="footnote">
<hr>
<a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> In the current version this will never be
shown, because <code>chronyd</code> has no support for reference clocks yet.</p>

   <p><hr></div>

</body></html>