Time changes
Hello,
On a redhat 5 server i get a different output each time i run the command : date.
for exp:
date
Mon May 11 15:46:49 WET 2015
date
Mon May 11 15:36:10 WET 2015
i stopped the ntp service but no change
what can cause this problem ?
thank you
bye
Responses
Hi Khawla,
Is this a physical or virtual machine?
Are you the only person logged in? ;-)
Do you see a pattern to how the time fluctuates?
Do you see any outbound connections on port 123?
# grep ^ntp /etc/services
ntp 123/tcp
ntp 123/udp # Network Time Protocol
# netstat -anp | grep ^[tu] | grep :123
udp 0 0 10.84.8.110:35723 97.107.131.6:123 ESTABLISHED 1729/chronyd
... truncated....
# grep ntp /var/log/messages
It sounds as though you have competing things attempting to control your clock (likely NTP and the Hypervisor tools). Unfortunately there are quite a few ways that you could have your environment configured - and I have no experience with Hyper-V.
For example, if using Vmware and NTP, there is a VM-specific setting they recommend.
Set tools.syncTime = "FALSE" in the configuration file (.vmx file) of the virtual machine.
From my limited research, it appears that Hyper-V also has a Time Synchronization capability
https://technet.microsoft.com/en-us/library/dn798297.aspx
and it appears that most folks do not recommend disabling it.
Hopefully a Portal member with more Hyper-V experience can chime in, but I would review that doc and investigate what best-practice Microsoft recommends.
We use VMware ESXi, but from my experience with RHEL VMs we simplify things by disabling NTP on the VM guest hosts and ensure the VM HOSTs' NTPd syncs to our NTP server and the guest will correctly pick up the clock times. I've only seen the RHEL guest VMs drift when the vmtoolsd daemon crashed or died and we didn't know it, restarting it corrected the time immediately. Now we have a simple check script ensures the vmtools are always running.
Hope this helps.
VMware tools' timekeeping has, historically, been suboptimal. If you're AD-integrating, best results come from letting your AD tools time-slave to the domain controllers. Otherwise, I'd probably go with ntpd (though, ntpd needs a real NTP server since AD uses an SNTP implementation that ntpd is happy to use for an initial-sync but not a continuous sync against).
In general, unless you like your logs spammed with time-adjustment events (and audispd calling out all the time resets), you really want to make sure only one sync method is being used.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
