0

In the past, I was using this command in my Ansible playbooks:

ntpdate pool.ntp.org

And it worked. But now, on Centos 8 ntpdate is no longer supported and chrony is used. However, the equivalent command

chronyd -q 'server pool.ntp.org iburst'

raises an error:

fatal: [localhost]: FAILED! => changed=true
  cmd: chronyd -q 'server pool.ntp.org iburst'
  delta: '0:00:00.005235'
  end: '2020-05-14 04:36:33.763055'
  msg: non-zero return code
  rc: 1
  start: '2020-05-14 04:36:33.757820'
  stderr: |-
    2020-05-14T08:36:33Z chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
    2020-05-14T08:36:33Z Fatal error : Another chronyd may already be running (pid=1338), check /var/run/chrony/chronyd.pid
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

How can I fix it?

Jacobian
  • 10,122
  • 29
  • 128
  • 221
  • try running "chronyc -a makestep" instead of the command you are running. – ilias-sp May 14 '20 at 09:27
  • @ilias-sp, what does this command do? Can it replace `ntpdate pool.ntp.org`? – Jacobian May 14 '20 at 12:13
  • as you found out already, chronyd cant be managed by ntpdate command. from `man chronyc`: The makestep command can be used in this situation. There are two forms of the command. The first form has no parameters. It tells chronyd to cancel any remaining correction that was being slewed and jump the system clock by the equivalent amount, making it correct immediately. – ilias-sp May 14 '20 at 14:51
  • @Jacobian You could always replace `chrony` with `ntp` and make life simple once again! – user3788685 May 16 '20 at 13:42

0 Answers0