Both sides previous revision Previous revision Next revision | Previous revision |
userdoc:tt_ntp_client_server [2016/12/03 00:38] – [Custom Configuration] abelbeck | userdoc:tt_ntp_client_server [2016/12/09 18:24] (current) – [Statistics and Debugging Commands] abelbeck |
---|
It can synchronize the system clock with NTP servers, and can also operate as an NTPv4 (RFC 5905) server and peer to provide a time service to other computers in the network. | It can synchronize the system clock with NTP servers, and can also operate as an NTPv4 (RFC 5905) server and peer to provide a time service to other computers in the network. |
| |
!!Note: AstLinux 1.2.9 or later is required!! | !!Note: AstLinux 1.2.9 or later is required for 'chrony' specific features!! |
===== NTP Client Configuration ===== | ===== NTP Client Configuration ===== |
| |
Locate the "NTP Server" entry within **Network Time Settings:** | Locate the "NTP Server" entry within **Network Time Settings:** |
| |
Enter user defined NTP Servers or select a regional "pool" server, “Save Settings”, then "Restart NTP Time" to apply. | Enter user defined NTP Servers (space separated) or select a regional "pool" server, “Save Settings”, then "Restart NTP Time" to apply. |
| |
!!Tip ->!! Any changes to the "Timezone" selection within this entry requires a System Reboot to apply. | !!Tip ->!! Any changes to the "Timezone" selection within this entry requires a System Reboot to apply. |
| |
| |
===== NTP Server Configuration ===== | ===== NTP Server Configuration ===== |
Nothing additional to configure, any local LAN interface device can use the LAN gateway address as an NTP server (UDP 123). | Nothing additional to configure, any local LAN interface device can use the LAN gateway address as an NTP server (UDP 123). |
| |
!!Tip ->!! By default, the DHCP "ntp-server" options field provides the NTP server for each network segment. | !!Tip ->!! By default, the DHCP "ntp-server" options field provides the NTP server for each DHCP configured network segment. |
| |
===== Custom Configuration ===== | ===== Custom Configuration ===== |
| |
By default a ''/etc/chrony.conf'' file is automatically generated from web interfaces settings. For most users this is sufficient. | By default a ''/etc/chrony.conf'' file is automatically generated from web interface settings. For most users this is sufficient, and recommended, providing automatic ''/etc/chrony.conf'' configuration tweaks over time. |
| |
For advanced users who want addition control of the ''/etc/chrony.conf'' configuration, they can create a persistent ''/mnt/kd/chrony.conf'' file that will be automaticly sym-linked to ''/etc/chrony.conf''. | For advanced users who want addition control of the ''/etc/chrony.conf'' configuration, they can create a persistent ''/mnt/kd/chrony.conf'' file that will be automatically sym-linked to ''/etc/chrony.conf''. |
| |
Using the CLI, here is a brief how-to to generate a custom configuration for chrony. | Using the CLI, here is a brief how-to on generating a custom configuration for chrony. |
| |
Create a persistent ''/mnt/kd/chrony.conf'' file from the current automatically generated version: | Create a persistent ''/mnt/kd/chrony.conf'' file from the current automatically generated version: |
cp /etc/chrony.conf /mnt/kd/chrony.conf | cp /etc/chrony.conf /mnt/kd/chrony.conf |
| |
Now edit ''/mnt/kd/chrony.conf'' to your liking, probably delete the "Autogenerated" first line. | Now edit ''/mnt/kd/chrony.conf'' to your liking, probably delete the "Autogenerated" first line so it won't confuse you later. |
| |
Now restart the NTP daemon with the new file: | Now restart the NTP daemon with the new ''/mnt/kd/chrony.conf'' file: |
| |
service ntpd stop | service ntpd stop |
service ntpd init | service ntpd init |
| |
!!Tip ->!! The Network tab will support editing the ''/mnt/kd/chrony.conf'' file if it exists. | !!Tip ->!! The web interface Network and Edit tab will support editing the ''/mnt/kd/chrony.conf'' file if it exists. |
| |
| If you want to specify a persistent driftfile, the destination directory must have ''ntp:ntp'' user/group privileges. For example: |
| |
| mkdir /mnt/kd/ntp |
| chown ntp:ntp /mnt/kd/ntp |
| |
| Then in your custom ''/mnt/kd/chrony.conf'' file, edit the driftfile line to: |
| |
| driftfile /mnt/kd/ntp/chrony.drift |
| |
| Then restart the NTP daemon (as above) to apply the change. |
| |
[[https://chrony.tuxfamily.org/documentation.html|Chrony Documentation]] | [[https://chrony.tuxfamily.org/documentation.html|Chrony Documentation]] |
===== Statistics and Debugging Commands ===== | ===== Statistics and Debugging Commands ===== |
| |
The ''chronyc'' command connects to the ''chronyd'' daemon to retrieve useful information. If ''chronyc'' is entered by itself you will enter an interactive mode with a ''chronyc>'' prompt. Or just enter ''chronyc'' commands on the command line. | The ''chronyc'' command connects to the ''chronyd'' daemon to retrieve useful information. If ''chronyc'' is entered by itself you will enter an interactive mode with a ''chronyc>'' prompt //(supports tab-completion of commands)//. Or just enter ''chronyc'' commands on the command line. |
| |
!!Note ->!! Some ''chronyc'' commands can actively change the ''chronyd'' operation, so carefully choose what commands you issue. Below are some //safe// examples. | !!Note ->!! Some ''chronyc'' commands can actively change the ''chronyd'' operation, so carefully choose what commands you issue. Below are some //safe// examples. |