From 9fb2bbecc81c2c05fe5a205f3b59ed02177da3c1 Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 3 Dec 2015 20:48:09 +0000 Subject: [PATCH] boot2docker: remove ntp, sync with host clock every hour For filesharing to work properly the VM and host clocks should be in-sync, even if the host clock has drifted relative to a good external timesource. This patch removes ntp from the VM and replaces it with an hourly sync with the VM's RTC which is plumbed into `gmtime`/`localtime` in `xhyve`. Fixes [docker/pinata#229] Signed-off-by: David Scott --- boot2docker/rootfs/crontab | 4 ++-- boot2docker/rootfs/rootfs/bootscript.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/boot2docker/rootfs/crontab b/boot2docker/rootfs/crontab index 27f299ed4..4113a1f43 100644 --- a/boot2docker/rootfs/crontab +++ b/boot2docker/rootfs/crontab @@ -1,2 +1,2 @@ -# restart ntpd to combat laptop sleep + VM pause -0 * * * * killall ntpd > /dev/null 2>&1; /etc/rc.d/ntpd +# resync with the host clock every hour +0 * * * * hwclock -s diff --git a/boot2docker/rootfs/rootfs/bootscript.sh b/boot2docker/rootfs/rootfs/bootscript.sh index 824e8808b..90d39829a 100755 --- a/boot2docker/rootfs/rootfs/bootscript.sh +++ b/boot2docker/rootfs/rootfs/bootscript.sh @@ -25,7 +25,7 @@ test -f "/var/lib/boot2docker/profile" && . "/var/lib/boot2docker/profile" /etc/rc.d/hostname # sync the clock -/etc/rc.d/ntpd & +#/etc/rc.d/ntpd & # start cron /etc/rc.d/crond