I have Freepbx running as a hyper-v vm. I was doing some updates to the Hyper-v server the other day and I just saved the state of all the VMs while doing this.
I have some time conditions in my setup and a few days later I realized the time on the FreePBX vm was off by about the same amount of time the vm had stayed in the “saved” state (about 1.5 hours). I was in a rush so did not check to see if the ntpd service was running or anything, and just rebooted in case there were other problems it was facing.
My Questions is how often does FreePBX (centOS) resync itself to time servers? Would have thought that after a few days it would have resynced itself. Can I change the intervals?
Anything I can do to have larger time gaps fixed automatically if they happen again in the future? I’d almost like to have a nightly reboot for unexpected instances and issues such as this one. I know it’s not a standard thing but since reboots fix 99% of problems maybe it would not be too bad to do.
It’s a three line script in a cron job. You shouldn’t need to reboot every (or any) night. Just configure ntp and run the “jumper” code from time to time. If you rely on ntp full time, you shouldn’t ever need it (since it adjust at random intervals throughout the day.
service ntpd stop; service ntpdate start; service ntpd start;
will stop ntpd, use ntpdate to refresh the time and then start ntpd backup again.
For testing… I did
date -s "2006-08-07 12:34:56-06:00"
and set my clock back a ways… then I ran:
service ntpd stop; service ntpdate start; service ntpd start;
and corrected the time.
not sure if
0 23 * * * service ntpd stop; service ntpdate start; service ntpd start;
will work from cron or not… might want to put those commands in a /usr/local/sbin/sync_clock script and call that from cron… but those commands might get you started.
@jfinstrom has a good point. To my way of thinking, Asterisk should skew to the correct time once in a while too.
All the ntpdate command will do is change the host time. If that’s not the issue, the problem is somewhere else.
@colin911 - you might want to put in a trouble ticket (Issues, above) describing what you saw. There might be a time-hack missing when the system comes out of the saved state? If it’s nothing, everyone is fine, if it’s a problem, I’d think it might need to be fixed.