ChronyControl - install and configure chronyd on MacOS X


chronycontrol icon
Download
Overview
Files Installed by ChronyControl
ChronyControl
MacOS X Date & Time
Rotating chronyd logs
ChronyControl Settings
Tracking Graph

Download

ChronyControl 1.2.1 - 16 September, 2017 - Download chronycontrol-1.2.1.zip

  • Updated embedded chrony to version 3.2
  • Updated to Swift 4.
  • Updated for High Sierra.
  • Fixed crash at start on El Capitan.


ChronyControl 1.1.6 - 31 January, 2017 - Download chronycontrol-1.1.6.zip

  • Updated embedded chrony to version 3.1


ChronyControl 1.1.5 - 18 January, 2017 - Download chronycontrol-1.1.5.zip

  • Updated embedded chrony to version 3.0


ChronyControl 1.1.4 - 22 November, 2016 - Download chronycontrol-1.1.4.zip

  • Updated embedded chrony to version 2.4.1
  • Compiled with Xcode 8.1


ChronyControl 1.1.3 - 7 June, 2016 - Download chronycontrol-1.1.3.zip

  • Updated embedded chrony to version 2.4.


ChronyControl 1.1.2 - 17 Feb, 2016 - Download chronycontrol-1.1.2.zip

  • Updated embedded chrony to version 2.3.
  • Fixed directory ownership when chronyd user is changed.


ChronyControl 1.1.1 - 16 Feb, 2016 - Download chronycontrol-1.1.1.zip

  • Fix unexpected quit if chrony config file has not been installed


ChronyControl 1.1.0 - 11 Feb, 2016 - Download chronycontrol-1.1.0.zip

  • chrony snapshot git 2.3-pre1-8-g910663c.
  • Included Sparkle framework for future updates.
  • Set chrony file locations (configuration and executables in preferences.
    This should allow ChronyControl to work with chrony installed manually or via Macports
  • Configuration file editor embedded.
  • Preliminary version of offset spectral analysis.
  • Interface overhaul


ChronyControl 1.0.0 - Download chronycontrol-1.0.0.zip

  • Initial release - embedded chrony software is current (19 August, 2015) git snapshot


Overview

MacOS X includes ntpd, probably the most widely used software for keeping a computer clock synchronised with other computers/clocks on the internet. However, unless the Mac is online for extended periods of time, ntpd can be very slow to synchronise with other clocks and the system time may be at wild variance with true time.

The chrony software addresses the issues associated with ntpd. This is fully explained in the FAQ

chrony has now been ported to MacOS X, and I have written a tool, ChronyControl, that will provide a straight forward means of installing and monitoring the daemon.


Files Installed by ChronyControl
ChronyControl will install the chrony software and associated files on your Macintosh
  • chronyd - /usr/local/bin
  • chronyc - /usr/local/bin
  • chronylogrotate.sh - /usr/local/bin
  • chrony.conf - /etc/chrony.d/chrony.conf
  • launchd plist - /Library/LaunchDaemons/org.tuxfamily.chronyd.plist
  • launchd plist - /Library/LaunchDaemons/org.tuxfamily.chronyc.plist
  • privileged helper - /Library/PrivilegedHelperTools/net.whatroute.chronycontrol

After installation you can also monitor and configure the chrony software from the command line, as you would on any other Unix system. The commands are documented at the chrony website.


ChronyControl

screenshot-ChronyControl

ChronyControl is primarily a front end to the chronyc tool delivered with the chrony software. It can show the overall server performance (tracking) and the state of individual remote time servers

ChronyControl bundles the most recent version of chrony (chronyc and chronyd) and, via the Settings button, can configure and install chronyd.

The upper clock displays the current time of your Mac. The centre hub of the clock will be red if chronyd is not running, orange if the daemon is running but is in an unsynchronised state, and green when chronyd is synchronised and disciplining the system clock.

The chronyc popup button enables you choose between the tracking, sources and sourcestats chronyc commands.

The popup button labeled Last offset below the performance meter in the screenshot, sends the corresponding value from the output of the tracking command to the meter.

Click the padlock icon (you'll be prompted for your login/password) to enable the Settings button.


MacOS X Date & Time

ChronyControl will disable "Set date and time automatically" in the System Preferences "Date & Time" panel. This terminates the ntpd daemon and prevents it from running. If you re-enable the setting, there is no guarantee as to which daemon, ntpd or chronyd, will be disciplining the system clock. Should you wish to go back to using ntpd, you should Uninstall chronyd (see below in ChronyControl Settings) before re-enabling the option in System Preferences.


Rotating chronyd logs

chronyd will (by default although this may be adjusted in the chrony.conf settings file) store statistics to the log files in the directory /var/log/chrony . ChronyControl installs a launchd job to rotate these logs on a daily basis, deleting the oldest (10 days) files.


ChronyControl Settings

These are privileged operations. You must first authenticate by pressing the small padlock in the lower left corner of the window in order to be able to use the Settings button to display the following window.

screenshot-ChronyControl Settings

Responses from the privileged helper to your button presses will be shown in the text field, Helper Response

You may be further prompted for your login/password when you click the buttons if the smaller 'helper' program has not yet been installed or is to be updated.

ButtonDescription
Edit Configuration Open the chronyd configuration file in the TextEdit editor. It's a plain text file and must not be changed to any other format. At the top of the file is a default set of ntp servers. These may be changed to your preferred servers.
A detailed description of the attributes used in the configuration file can be found at the chrony site
WARNING You should not change any of the other attributes, file paths or directories specified in the file. The launchd configuration files installed by ChronyControl assume that files will be located at the paths specified in the distributed configuration. This restriction will become more flexible in a later release of ChronyControl.
Install Configuration Copy the configuration file to /etc/chrony.d/chrony.conf
Install chronyd Install chronyd to /usr/local/sbin and a launchd plist to automate starting chronyd
Install chronyc in /usr/local/bin
Install chronylogrotate.sh to /usr/local/bin and a launchd plist to run the script on a daily basis
Uninstall chronyd Stop the daemon (if its running) and remove the components installed above
Stop chronyd Terminate the chronyd daemon
Start chronyd ummmmm .....
Dismiss Close the Settings window and return to the main ChronyControl screen


Tracking Graphs

The values shown in the tracking display can be displayed graphically as shown in the screen shots below. Select Tracking from the Windows menu to display the graphs.

The source of data for these graphs is the log file /var/log/chrony/tracking.log

The graph is updated in real time as chronyd adds records to the log file.

Explanation of the colours and data range settings can be seen by clicking the Legend button as shown in the second screen shot.

Controls on the right hand side can be used to zoom/re-scale the graph for either finer granularity or to gain an overview of the data.



screenshot-tracking graph


Exposing the Legend control.
screenshot-tracking legend graph