Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2011 11:42:19 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: system clock running 2h early although ntpd enabled
Message-ID:  <4D56721B.3080204@infracaninophile.co.uk>
In-Reply-To: <20110211221648.03c65a04@dijkstra>
References:  <20110211221648.03c65a04@dijkstra>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig64B858C008A516B3982421FB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 11/02/2011 21:16, Christopher J. Ruwe wrote:
> Since some weeks my local clock runs two hours early. My /etc/localtime=

> is a copy of /usr/share/zoneinfo/Europe/Berlin and I have set both
> ntpd_enable=3D"YES" and ntpd_sync_on_start=3D"YES". My ntp.conf consist=
s of=20
>=20
> server ntp1.ptb.de prefer
> server ntp2.ptb.de
> restrict default ignore
> restrict 127.0.0.1
>=20
> Surely, I must be missing something. Does anybody have an idea?
>=20

Sounds like your CMOS clock is set to local wallclock time, but you
haven't got the /etc/wall_cmos_clock file.  Or vice-versa: your CMOS
clock is set to UTC, but you've got the wall_cmos_clock file.  See
adjkerntz(8) for details.  The CMOS clock is what drives the time/date
display shown in the system BIOS, and it's separate from the clock used
for the system time when the OS is running.

On unix systems, the system clock always runs in UTC, and an appropriate
offset will be calculated for your timezone whenever you want to display
the time.

ntpd will synch your system clock to UTC, except that on reboot the
systems' initial concept of what time it is comes from the CMOS clock,
possibly offset by a certain number of hours if it thinks the CMOS clock
is using local wall-clock time.  Now, if the kernel is mistakenly
applying a timezone correction, it can put the system clock outside the
sanity check offset that ntpd uses, so ntpd may never synch to the right
time.  As suggested elsethread, you can use the '-g' flag to ntpd to
force it to always synch on startup even if the time is way out.  Even
so it helps your system stabilise a bit faster after reboot if your
kernel can derive something more like the right system time from the
CMOS clock.

Personally, if the machine is dedicated to running FreeBSD (or FreeBSD
and other unixoid OSes) I'd set the CMOS clock to UTC[*] and remove
/etc/wall_cmos_clock.  Otherwise (ie. if you need to boot into Windows)
do it the other way: set the CMOS clock to local wall clock time and
make sure /etc/wall_cmos_clock exists.

	Cheers,

	Matthew

[*] Well, considering where I live, for half the year this is a null op
in any case...

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enig64B858C008A516B3982421FB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1WciMACgkQ8Mjk52CukIwtTgCfW78A0bG+WXmLWYUQe9nbZsRR
O8EAninUltsI7VQyABj93ksNNPqYpOJp
=ZrFm
-----END PGP SIGNATURE-----

--------------enig64B858C008A516B3982421FB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D56721B.3080204>