I am using the following command to synchronise the time on a Oracle Linux 6.5:
ntpd -gq
Unfortunately it does not timeout when an Internet connection is not available. Is this possible or should implement my own timeout mechanism?
I am using the following command to synchronise the time on a Oracle Linux 6.5:
ntpd -gq
Unfortunately it does not timeout when an Internet connection is not available. Is this possible or should implement my own timeout mechanism?
If you're on an intermittently connected machine like a laptop, consider using something other than ntpd, such as chrony, which is designed for situations like this. It is available in EPEL for RHEL 6 and is the default NTP client/server in RHEL 7.
To accomplish this, set the offline
option on the server
s in your chrony.conf
file, and then run the chronyc online
command whenever you connect to the Internet.