Monday, 3 January 2022

Job chronyd.service/start failed with result 'dependency'

 Job chronyd.service/start failed with result 'dependency'


Issue :  CRITICAL: Neither ntpd nor chronyd running. Exiting 

Error :  systemd[1]: Dependency failed for NTP client/server.

systemd[1]: Job chronyd.service/start failed with result 'dependency'.



By default, the NTP service available on Oracle Linux 7 and Red Hat Linux 7 is chronyd and

the NTP service available on Oracle Linux 6 and Red Hat Linux 6 or lower is ntpd.  

 

configuration file : /etc/chrony.conf


chrony RPM :

# yum list |grep chrony

chrony.x86_64                     3.4-1.0.1.el7   @goit-patch

collectd-chrony.x86_64            5.8.1-1.el7     epel_7_x86_64


# systemctl enable chronyd

Failed to execute operation: Connection timed out


# journalctl -u chronyd.service

-- Logs begin at Fri 2021-03-19 16:03:12 EDT, end at Wed 2021-03-24 16:25:56 EDT. --

Mar 19 16:07:35  systemd[1]: Dependency failed for NTP client/server.

Mar 19 16:07:35  systemd[1]: Job chronyd.service/start failed with result 'dependency'.


# systemctl status -l chronyd

● chronyd.service - NTP client/server

   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)

   Active: inactive (dead)

     Docs: man:chronyd(8)

           man:chrony.conf(5)


Mar 19 16:07:35 systemd[1]: Dependency failed for NTP client/server.

Mar 19 16:07:35  systemd[1]: Job chronyd.service/start failed with result 'dependency'.


# date;hwclock

Wed Mar 24 16:32:46 EDT 2021

Wed 24 Mar 2021 04:32:45 PM EDT  -0.747989 seconds


Disable chronyd :

# systemctl disable chronyd

Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.

# systemctl disable ntpd

Removed symlink /etc/systemd/system/multi-user.target.wants/ntpd.service.

check NTP service :

# systemctl list-unit-files |grep ntpd

ntpd.service                                  disabled

ntpdate.service                               disabled


Enable chronyd:

# systemctl enable chronyd

Created symlink from /etc/systemd/system/multi-user.target.wants/chronyd.service to /usr/lib/systemd/system/chronyd.service.

Check the chronyd service :

# systemctl list-unit-files |grep chronyd

chronyd.service                               enabled

#  systemctl start chronyd


To check the status of the chronyd daemon :

# systemctl status chronyd

● chronyd.service - NTP client/server

   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)

   Active: active (running) since Wed 2021-03-24 16:36:09 EDT; 8s ago

     Docs: man:chronyd(8)

           man:chrony.conf(5)

  Process: 24655 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)

  Process: 24649 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)

 Main PID: 24651 (chronyd)

   CGroup: /system.slice/chronyd.service

           └─24651 /usr/sbin/chronyd


Mar 24 16:36:09  systemd[1]: Starting NTP client/server...

Mar 24 16:36:09  chronyd[24651]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)

Mar 24 16:36:09  chronyd[24651]: commandkey directive is no longer supported

Mar 24 16:36:09  chronyd[24651]: generatecommandkey directive is no longer supported

Mar 24 16:36:09  chronyd[24651]: Frequency 6.328 +/- 0.003 ppm read from /var/lib/chrony/drift

Mar 24 16:36:09  systemd[1]: Started NTP client/server.

Mar 24 16:36:14  chronyd[24651]: Selected source 10.38.64.8

Mar 24 16:36:14  chronyd[24651]: System clock wrong by -2.424961 seconds, adjustment started


 Below are some useful commands :


# chronyc tracking

Reference ID    : 0A264008 (cssknmuscghhb02.ntp.ge.com)

Stratum         : 3

Ref time (UTC)  : Wed Mar 24 21:01:05 2021

System time     : 0.000067756 seconds fast of NTP time

Last offset     : +0.000067914 seconds

RMS offset      : 0.000093996 seconds

Frequency       : 6.310 ppm fast

Residual freq   : +0.004 ppm

Skew            : 0.229 ppm

Root delay      : 0.013916761 seconds

Root dispersion : 0.004114292 seconds

Update interval : 64.9 seconds

Leap status     : Normal


# chronyc sources

210 Number of sources = 4

MS Name/IP address         Stratum Poll Reach LastRx Last sample

===============================================================================

^+ cssknmvvvvv.ntp.gde.c>     2   7   377    56  -4988us[-4920us] +/-   24ms

^- cssknefdsfvc02.ntp.gde.c>     2   7   377   313  +3474us[+3474us] +/-   49ms

^* cssknmuscxxxb02.scgdn.gce.c>     2   6   377    53  +2412us[+2480us] +/-   11ms

^- csskneuxxxxx2.gdsan.gae.c>     2   6   377    53  +2862us[+2862us] +/-   47ms


# chronyc sourcestats

210 Number of sources = 4

Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev

==============================================================================

cssknmucscscscsn.gdde.c>  20   9   24m     -0.005      0.217  -5050us    98us

cssknenladcscds2.gdn.ge.c>  21  14   20m     -0.021      0.070  +3418us    25us

ntp2.ntp.gse.com             7   5   390     +0.029      0.739  +2405us    42us

csskneuklinhcsd2.ntp.gse.c>  14   9   905     +0.007      0.070  +2860us    19us


# chronyc activity

200 OK

4 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address


[root@gf250sa1usplagcfefp ~]# timedatectl

      Local time: Wed 2021-03-24 16:38:30 EDT

  Universal time: Wed 2021-03-24 20:38:30 UTC

        RTC time: Wed 2021-03-24 20:38:30

       Time zone: EST5EDT (EDT, -0400)

     NTP enabled: yes

NTP synchronized: yes

 RTC in local TZ: no

      DST active: yes

 Last DST change: DST began at

                  Sun 2021-03-14 01:59:59 EST

                  Sun 2021-03-14 03:00:00 EDT

 Next DST change: DST ends (the clock jumps one hour backwards) at

                  Sun 2021-11-07 01:59:59 EDT

                  Sun 2021-11-07 01:00:00 EST

  

  

Running chronyc sources -v shows the current state of the NTP server/s configured in the system :

# chronyc sources -v

210 Number of sources = 4


  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.

 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,

| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.

||                                                 .- xxxx [ yyyy ] +/- zzzz

||      Reachability register (octal) -.           |  xxxx = adjusted offset,

||      Log2(Polling interval) --.      |          |  yyyy = measured offset,

||                                \     |          |  zzzz = estimated error.

||                                 |    |           \

MS Name/IP address         Stratum Poll Reach LastRx Last sample

===============================================================================

^+ cssknmusalphb4602.gdn.gje.c>     2   6    77    29  -4992us[-4943us] +/-   23ms

^- cssknenlahmehbdhs2.ntp.gje.c>     2   6    77    28  +3310us[+3358us] +/-   49ms

^* cssknmuscchvsahu02.gdn.gje.c>     2   6    77    28  +2330us[+2379us] +/-   11ms

^- csskneuklhyhbscad.gdn.gje.c>     2   6    77    29  +2789us[+2838us] +/-   47ms




Job chronyd.service/start failed with result 'dependency'

 Job chronyd.service/start failed with result 'dependency' Issue :  CRITICAL: Neither ntpd nor chronyd running. Exiting  Error :  sy...