savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Savannah-hackers-public] Xen domU time drift


From: Bernie Innocenti
Subject: Re: [Savannah-hackers-public] Xen domU time drift
Date: Fri, 17 Dec 2010 16:45:31 -0500

On Fri, 2010-12-17 at 20:57 +0100, Sylvain Beucler wrote:
> Hi,
> 
> There's a time drift in the colonialone.fsf.org domUs:
> https://savannah.gnu.org/support/index.php?107551
> 
> I don't think this happened in the previous install, but maybe we just
> weren't aware of it.  I expect domUs to sync with the dom0.
> 
> 
> Do you have a recommendation to fix it?
> (Do you have this issue on other Xen installs?)

Time drift on domU is a known issue with our version of xen. We fix it
by installing a hourly cronjob:

----------8<-----------8<-----------8<-----------8<-----------8<----------
aptitude install ntpdate
cat >/etc/cron.d/ntpdate <<__EOF__
# Make sure that our clock stays more or less within sync
# The clock-sync script automatically adjusts if it is run on a Xen domU

0 * * * * root /usr/local/bin/clock-sync.sh
__EOF__
cat >/usr/local/bin/clock-sync.sh <<__EOF__
#!/bin/sh

if [ -d /proc/sys/xen ]; then 
        echo 1 > /proc/sys/xen/independent_wallclock; 
        /usr/sbin/ntpdate pool.ntp.org >> /dev/null 2>&1
else
        /usr/sbin/ntpdate pool.ntp.org >> /dev/null 2>&1
        /sbin/hwclock -w
fi
__EOF__
chmod 755 /usr/local/bin/clock-sync.sh
----------8<-----------8<-----------8<-----------8<-----------8<----------

Then run it by hand once:

date ; /usr/local/bin/clock-sync.sh ; date

Alternatively, you could run ntpd, but it has higher resource usage.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]