Difference between revisions of "Chrony"

From ArchWiki
Jump to: navigation, search
(Initial draft of the Chrony wiki page, based heavily on the NTPd article and the Chrony user guide. WIP - will finish later.)
(No difference)

Revision as of 17:06, 30 October 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This article describes how to set up and run Chrony, an alternative NTP client and server that is dial-up friendly and designed specifically for systems that are not online all the time.


Template:Package Official is available from the [extra] repository.


The first thing you define in your Template:Filename is the servers your machine will synchronize to. NTP servers are classified in a hierarchical system with many levels called strata: the devices which are considered independent time sources are classified as stratum 0 sources; the servers directly connected to stratum 0 devices are classified as stratum 1 sources; servers connected to stratum 1 sources are then classified as stratum 2 sources and so on.

It has to be understood that a server's stratum cannot be taken as an indication of its accuracy or reliability. Typically, stratum 2 servers are used for general synchronization purposes: if you do not already know the servers you are going to connect to, you should use the pool.ntp.org servers (alternate link) and choose the server pool that is closest to your location.

The following lines are just an example:

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

If your computer is not connected to the internet on startup, it is recommended to use the offline option, to tell chrony not to try and connect to the servers, until it has been given the go:

server 0.pool.ntp.org offline
server 1.pool.ntp.org offline
server 2.pool.ntp.org offline
server 3.pool.ntp.org offline

It may also be a good idea to either use IP addresses instead of host names, or to map the hostnames to IP addresses in your Template:Filename file, as DNS resolving won't be available until you've made a connection.

To tell chronyd that a connection has been established, you need to be able to log in with chronyc. You will have to configure chronyd with an administrator password to be able to do this. Setting up an administrator password is as simple as creating the file Template:Filename with a single line:


as well as adding the following line somewhere in Template:Filename:

commandkey 1

The smallest useful configuration file (using IP addresses instead of a hostname) would look something like:


Telling chronyd an internet connection has been made

For this to work, you'll need toconfigure the Template:Codeline option in Template:Filename as shown above, [...]

In conclusion, don't forget the user guide at Template:Filename, which is likely to answer any doubts you could still have. It is also available online. See also the related man pages: Template:Codeline).


Starting ntpd

chronyd runs as a daemon in the background, keeping track of the clock, and waiting for it to be told to go online and synchronize the time with the servers.

Stop the hwclock daemon (if it is running):


Start the chrony daemon: Template:Cli

Add chrony to your DAEMONS array so it starts automatically on boot and make sure hwclock is disabled: Template:File

Using NetworkManager to let chronyd go online

chronyd can be go into online/offline mode along with a network connection through the use of NetworkManager's dispatcher scripts. -You can install the needed script from [community] (will be AUR):



Alternatives to the Chrony, are NTPd, the standard NTP client/daemon for Linux, and OpenNTPD, part of the OpenBSD project and currently not maintained for Linux.

See also

  • Time (for more information on computer timekeeping)

External links