Timeserver sending wrong time to Windows Clients

Andrew Bartlett abartlet at pcug.org.au
Fri Mar 23 06:16:43 GMT 2001


David Rankin wrote:
> 
> Andrew Bartlett wrote:
> 
> > David Rankin wrote:
> > >
> > > Help Andrew! and whoever else..
> > >
> > > I have a Linux Mandrake 7.2 box with Samba 2.07 acting as a timeserver
> > > for our local lan. We are in the CST timezone. All windows boxes sync
> > > thier time from the Linux box via: net time \\Nemesis /set /yes. I would
> > > like to have xntp keep the clock on the server updated.
> > >
> > > Problem:
> > >
> > > ntpdate and xntp work great at setting the Linux box hardware clock to
> > > GMT.
> > >
> > > The problem I am having is that my windows clients do not get the right
> > > time no matter what I set the zoneinfo or timezone or Linux system clock
> > > to. It almost appears that my zoneinfo of [America/Chicago] adds 6 hours
> > > to GMT instead or subtracting 6 hours to get the correct local time.
> > >
> > > If the hwclock is set to GMT and zoneinfo is set to [no selection], the
> > > windows boxes get GMT. (i.e. correct time + 6 hours).
> > >
> > > If the hwclock is set to GMT and zoneinfo is set to [America/Chicago]
> > > (CST), the windows boxes get GMT + 6 (i.e. correct time + 12 hours) -
> > > Totally Bizarre!
> > >
> > > I have tried every combination of hwclock/system clock and zoneinfo
> > > settings available and the only way I get the windows boxes to get the
> > > right time is to set the hwclock to localtime (CST) and the zoneinfo to
> > > [no selection]. Of course this makes xntp useless because when it tries
> > > to update it sees a 21600 second difference in time and just pukes and
> > > dies!
> > >
> > > I have read all How-Tos and Mini How-Tos, man pages, listserve archives,
> > > etc and I am still at a loss. I don't understand what in the heck is
> > > going on. I need help figuring out how samba figures out  what time it
> > > serves to the windows boxes.
> > >
> > > I am out of ideas and dead in the water on this one -- alas with a
> > > feeling of defeat, I now send this question to the Linux Omniscient for
> > > help.
> > >
> > > --
> > > David Rankin
> > > Nacogdoches, Texas
> >
> > First, set your hardware clock to GMT.  Ensure that all programs
> > accessing the hardware clock know this.
> >
> 
> Andrew, I am still having problems. I have checked and rechecked everything
> and here is what is happening:
> 
> [root at Nemesis /etc]# ntpdate ntp5.tamu.edu
> 22 Mar 23:32:29 ntpdate[15408]: adjust time server 165.91.52.110 offset
> 0.000278 sec
> 
> THIS SHOWS NTP SET THE CLOCK TO LOCALTIME - I DON'T GET IT?
> 
> [root at Nemesis /etc]# date
> Thu Mar 22 23:32:44 CST 2001
> 
> DATE SHOWS CORRECT LOCALTIME
> 
> [root at Nemesis /etc]# hwclock
> Thu Mar 22 17:32:45 2001  -0.625124 seconds
> 
> HWCLOCK SHOWS TIME SET 12 HOURS SLOW - HMMM

By my math thats actually 6 hours slow, ie correct.

Unfortunately hwclock has no way to tell if the hardware clock is in
local time or UTC.  Run hwclock --utc to have answers converted to your
local timezone.  (This is all the UTC/localtime setting actually does,
it just selects the command line for hwclock).

In any case, if the system keeps its time over a reboot, then this is
not the issue.  I certainly see no signs that the hardware level is at
fault.

At the level samba and NTP operate the hardware clock is irrelevant,
only hwclock actually touches it.

> 
> [root at Nemesis /etc]# zdump /usr/share/zoneinfo/CDT6CST
> /usr/share/zoneinfo/CDT6CST  Thu Mar 22 23:34:22 2001 /usr/share/zoneinfo/CDT
> [root at Nemesis /etc]# zdump /usr/share/zoneinfo/Europe/London
> /usr/share/zoneinfo/Europe/London  Fri Mar 23 05:36:02 2001 GMT
> 
> ZDUMP WORKS RIGHT FOR BOTH CST AND GMT
> 
> [root at Nemesis /etc]# date
> Thu Mar 22 23:36:40 CST 2001
> 
> DATE STILL WORKING RIGHT
> 
> After a brief Win98 reboot
> 
> C:\WINDOWS>net time \\Nemesis /set /yes
> Current time at \\NEMESIS is 3-23-2001 5:47A.M.
> The command was completed successfully.
> 
> WINDOWS CLIENTS STILL GET GMT - ANY THOUGHTS?
> 
> Like I said, I a fresh out of ideas. I read and read and I think I have
> everything ironed out and no matter what I do, windows still gets time 6 hours
> ahead of what it should.
> --
> David Rankin
> Nacogdoches, Texas

What value do you have for 'time offset' (in smb.conf).  It just looks
too much like you have specified what you thought was the timezone in
'time offset' only to have samba do 'timezone + time offset' in its
calculations.  

(I actually am yet to see a good use for 'time offset', no doubt there
is, but anyway).

In any case, the worst case scenario is to install NTPtime, an open
source delphi program that just polls a time (NTP) server and sets the
system clock.  (I've used this, and it works spectacularly.  I have an
entire network using it off my central time server.).

Hope this helps,
Andrew Bartlett

-- 
Andrew Bartlett
abartlet at pcug.org.au




More information about the samba mailing list