#1137431 ntpsec: ntpwait fails immediately if ntpsec service has not yet started

Package:
ntpsec
Source:
ntpsec
Description:
Network Time Protocol daemon and utility programs
Submitter:
Aaron Bugher
Date:
2026-05-23 18:59:02 UTC
Severity:
normal
#1137431#5
Date:
2026-05-23 18:57:01 UTC
From:
To:
Dear Maintainer,

This may be considered either a bug in functionality or a bug in the documentation.  `man ntpwait` says, "The ntpwait program blocks until ntpd is in synchronized state."  That is only true if the ntpsec service is already running.

I have a cron job that runs at boot time and should wait for NTP synchronization.  Apparently the cron service can start before the ntpsec service, so using ntpwait in the script causes immediate failure instead of waiting for ntpd (ntpsec) to start and synchronize.

Example:


ansible@neuron-mail:~$ sudo systemctl stop ntpsec
ansible@neuron-mail:~$ # This fails immediately.
ansible@neuron-mail:~$ ntpwait
localhost: timed out, nothing received
***Socket error; probably ntpd is not running
Leap status not available
ansible@neuron-mail:~$ echo $?
1
ansible@neuron-mail:~$ sudo systemctl start ntpsec
ansible@neuron-mail:~$ # This works as expected.
ansible@neuron-mail:~$ ntpwait
ansible@neuron-mail:~$ echo $?
0
ansible@neuron-mail:~$