Koozali.org: home of the SME Server

Time out of sync

Offline EdelingF

  • *****
  • 215
  • +0/-0
Time out of sync
« on: November 29, 2013, 11:26:14 AM »
Just noticed time on my server was out of sync. It appeared the servertime was stil november 16th.
My server is a virtual server (Virtualbox) and I have read a lot of (old SME7) posts about time being out of sync due to a VMware problem, but nothing about Virtualbox.
Does anyone has experienced time being out of sync on a Virtualbox server? Should I just use mmccarn's solution on: http://forums.contribs.org/index.php/topic,32139.msg139191.html#msg139191
I can imagine disabeling the local hardware clock could work?
...

Offline stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: Time out of sync
« Reply #1 on: November 29, 2013, 06:10:58 PM »
i have many sme server virtualized by virtualbox and i never seen your issue.
what is your  current version of virtualbox, i use phpvirtualbox and virtualbox 4.3
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #2 on: November 29, 2013, 08:33:41 PM »
My current version of Virtualbox is 4.2.18 and phpVirtualBox 4.2-8
I updated the server in october I believe.

I just checked the time on the server and it seems it is still the same as this morning. It doesn't seem to count/refresh, how do you call it
...

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #3 on: November 29, 2013, 08:38:58 PM »
It appears the time in Server-Manager and the hardwareclock differ.
The time in Server-Manager doesn't change after refreshing the page, the hardwareclock does.

Code: [Select]
]# hwclock
vr 29 nov 2013 20:36:41 CET  -0.000455 seconden
...

Offline stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: Time out of sync
« Reply #4 on: November 29, 2013, 11:35:53 PM »
did you try a reconfigure of your server, maybe it can repair your problem as the issue concern only the server-manager
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

guest22

Re: Time out of sync
« Reply #5 on: November 30, 2013, 12:15:15 AM »
I wonder if this has anything to do with this issue:

http://wiki.contribs.org/Virtual_SME_Server#Clock.2Ffrequency

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #6 on: November 30, 2013, 11:19:09 AM »
I was wrong! Sorry guys, I did hwclock on the server, not the virtual server.
This is what I get now, at this moment:
Code: [Select]
[root@sme8 ~]# hwclock
zo 17 nov 2013 00:33:06 CET  -0.858610 seconden
[root@sme8 ~]# date
vr nov 29 22:03:09 CET 2013

Time on the server in Server-Manager is ok:  za 30 nov 2013 11:11:34 CET and it synchronizes with smeserver.pool.ntp.org
Time on the virtual server is : vr 29 nov 2013 22:04:29 CET

I also looked into the clock frequency and this is the result:
Code: [Select]
[root@sme8 ~]# grep CONFIG_HZ /boot/config-`uname -r`
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000

I'll try the suggested solution.
« Last Edit: November 30, 2013, 11:20:50 AM by EdelingF »
...

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #7 on: November 30, 2013, 11:44:37 AM »
The result is:
Code: [Select]
[root@sme8 ~]# hwclock
vr 29 nov 2013 22:10:23 CET  -0.332284 seconden
[root@sme8 ~]# date
za nov 30 11:37:36 CET 2013
...

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #8 on: November 30, 2013, 08:23:18 PM »
Apperently syncing stopped again for some reason:
Code: [Select]
[root@sme8 ~]# hwclock
za 30 nov 2013 16:25:53 CET  -0.428388 seconden
[root@sme8 ~]# date
za nov 30 16:28:04 CET 2013
...

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #9 on: December 07, 2013, 03:48:01 PM »
Turned off time syncing between server and virtual server:
Code: [Select]
vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
Also switched off syncing with NTP-server. Manually put it the time and now time is only about 6 hours out of sync in 24 hours.
Still not solved, but workable for the time being. Still can't figure out why the VM isn't syncing with the NTP-server
...

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Time out of sync
« Reply #10 on: December 07, 2013, 05:06:20 PM »
Still can't figure out why the VM isn't syncing with the NTP-server

-g
    Normally, ntpd exits if the offset exceeds the sanity limit, which is 1000 s by default. If the sanity limit is set to zero, no sanity checking is performed and any offset is acceptable. This option overrides the limit and allows the time to be set to any value without restriction; however, this can happen only once. After that, ntpd will exit if the limit is exceeded. This option can be used with the -q option.

I enter this into the 'NTP Server' field in server-manager on virtual hosts:
Code: [Select]
smeserver.pool.ntp.org minpoll 10 maxpoll 11- Play with the values for minpoll & maxpoll
- Read more in this Bug 5648

On my SME8 it looks like this might help, too:
Code: [Select]
config setprop ntpd SupportLargeDrive enabled
signal-event timeserver-update

If all else fails, you could schedule a cronjob to forcefully reset the server's time using
Code: [Select]
ntpdate -d pool.ntp.org

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #11 on: December 07, 2013, 05:34:45 PM »
Thanks, I'll look into that.

I allready tried to put the
Code: [Select]
smeserver.pool.ntp.org minpoll 10 maxpoll 11 into the 'NTP Server' field in server-manager, but that resulted in an error. SME says it's not a valid serveraddress

The result of
Code: [Select]
signal-event timeserver-update is:
Code: [Select]
no connection to syslog available
        - /dev/log is not a socket
        - /dev/log is not a socket at /usr/lib/perl5/site_perl/esmith/Logger.pm line 42

Did you mean:
Code: [Select]
config setprop ntpd SupportLargeDrift enabled
expand-template /etc/ntp.conf
?
I tried that allready after reading http://wiki.contribs.org/Virtual_SME_Server#Clock.2Ffrequency
...

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Time out of sync
« Reply #12 on: December 08, 2013, 05:44:19 AM »
I allready tried to put the
Code: [Select]
smeserver.pool.ntp.org minpoll 10 maxpoll 11 into the 'NTP Server' field in server-manager, but that resulted in an error. SME says it's not a valid serveraddress

Hmmm. 

That's what I have in server-manager; I must have entered it at the command line:
Code: [Select]
config setprop ntpd NTPServer 'smeserver.pool.ntp.org minpoll 10 maxpoll 11'(single quotes required)

signal-event timeserver-update
- works fine on my system (no errors).  I don't know what it means (if anything) that you're getting an error.

Offline EdelingF

  • *****
  • 215
  • +0/-0
Re: Time out of sync
« Reply #13 on: December 08, 2013, 10:32:46 AM »
Ok, that explanes it. Tried that and the result was an error:
Code: [Select]
[root@sme8 ~]# config setprop ntpd NTPServer 'smeserver.pool.ntp.org minpoll 10 maxpoll 11'
no connection to syslog available
        - /dev/log is not a socket at /usr/lib/perl5/site_perl/esmith/config.pm line 598

That's the second perl error, maybe that's where the problem is?
...

guest22

Re: Time out of sync
« Reply #14 on: December 08, 2013, 11:11:44 AM »
what is the output of this command on the console please?:

'service syslog status'