What’s new in RHEL7: Chrony

NTP service is provided by Chrony.

[root@rtfmp ~]# yum info chrony
Name        : chrony
Arch        : x86_64
Version     : 2.1.1
Release     : 1.el7.centos
Size        : 280 k
Repo        : base/7/x86_64
Summary     : An NTP client/server
URL         : http://chrony.tuxfamily.org
License     : GPLv2
Description : A client/server for the Network Time Protocol, this program keeps
            : your computer's clock accurate. It was specially designed to
            : support systems with intermittent internet connections, but it
            : also works well in permanently connected environments. It can use
            : also hardware reference clocks, system real-time clock or manual
            : input as time references.

If it is not installed, install it using

yum install chrony -y

The configuration file is /etc/chrony.conf.

[root@rtfmp ~]# rpm -qc chrony
/etc/chrony.conf
/etc/chrony.keys
/etc/logrotate.d/chrony

[root@rtfmp ~]# grep server /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Serve time even if not synchronized to any NTP server.

Enable and start the service.

[root@rtfmp ~]# systemctl enable chronyd
[root@rtfmp ~]# systemctl start chronyd
[root@rtfmp ~]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-10-16 00:35:24 IST; 5s ago
  Process: 2624 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 2620 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 2622 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─2622 /usr/sbin/chronyd

Oct 16 00:35:24 rtfmp.localdomain systemd[1]: Starting NTP client/server...
Oct 16 00:35:24 rtfmp.localdomain chronyd[2622]: chronyd version 2.1.1 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +DEBUG +ASYNCDNS +IPV6 +SECHASH)
Oct 16 00:35:24 rtfmp.localdomain chronyd[2622]: Generated key 1
Oct 16 00:35:24 rtfmp.localdomain systemd[1]: Started NTP client/server.

The daemon is called chronyd as we see above and the command line utility to query and manipute chrony is chronyc. You can run chronyc from your login shell or you can enter chronyc shell just by running chronyc.

    [root@rtfmp ~]# chronyc  sources
    210 Number of sources = 3
    MS Name/IP address         Stratum Poll Reach LastRx Last sample
    ===============================================================================
    ^+ 125.62.193.121                2   6    77    19    -32ms[  -32ms] +/-  236ms
    ^+ 123.108.200.124               3   6    77    19    +33ms[  +33ms] +/-  224ms
    ^* ec2-52-66-76-135.ap-south     2   6    77    21  -1498us[-1699us] +/-  149ms
    [root@rtfmp ~]# chronyc
    chrony version 2.1.1
    Copyright (C) 1997-2003, 2007, 2009-2015 Richard P. Curnow and others
    chrony comes with ABSOLUTELY NO WARRANTY.  This is free software, and
    you are welcome to redistribute it under certain conditions.  See the
    GNU General Public License version 2 for details.

    chronyc> sources
    210 Number of sources = 3
    MS Name/IP address         Stratum Poll Reach LastRx Last sample
    ===============================================================================
    ^+ 125.62.193.121                2   6    77    24    -32ms[  -32ms] +/-  236ms
    ^+ 123.108.200.124               3   6    77    24    +33ms[  +33ms] +/-  224ms
    ^* ec2-52-66-76-135.ap-south     2   6    77    26  -1498us[-1699us] +/-  149ms

chronyc comes with a plethora of commands which you can see by running chrony help.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s