From: Dave Uhring on
On Mon, 07 Apr 2008 08:46:10 +0200, Àngel Català wrote:
> Dave Uhring escribiĂł:

>> If your CMOS clock is set to CET, which it would be for your locale and
>> you have chosen UTC as your local time then that is expected.
>>
>> Copy /usr/share/zoneinfo/Europe/Madrid to /etc/localtime and see if
>> that helps.

> I have tryed copying that file to /etc/localtime, but it still is wrong.

What is the content of /etc/timezone? Valencia has the same time as
Madrid, no? Then /etc/timezone should have

Europe/Madrid

> In /etc/default/rcS, I have UTC=no (by default). In "Debian GNU/Linux
> System Administrator's Manual. Chapter 16 - Time" it can be read: "To
> change the computer to use UTC after installation, edit the file
> /etc/default/rcS, change the variable UTC to no". I thought if you
> wanted use UTC you should set the variable UTC to yes, but it seems on
> the other hand.

Then the manual is in error. Read the man page rcS(5).

Since you stated that Windows keeps correct time then your CMOS clock is
set to localtime, not UTC, and /etc/default/rcS *should* read UTC=no.

From: Àngel Català on
Hi Dave,

>>> If your CMOS clock is set to CET, which it would be for your locale and
>>> you have chosen UTC as your local time then that is expected.
>>>
>>> Copy /usr/share/zoneinfo/Europe/Madrid to /etc/localtime and see if
>>> that helps.
>
>> I have tryed copying that file to /etc/localtime, but it still is wrong.
>
> What is the content of /etc/timezone? Valencia has the same time as
> Madrid, no? Then /etc/timezone should have
>
> Europe/Madrid


That's right, Valencia has the same time zone as Madrid and my
/etc/timezone is "Europe/Madrid"

>> In /etc/default/rcS, I have UTC=no (by default). In "Debian GNU/Linux
>> System Administrator's Manual. Chapter 16 - Time" it can be read: "To
>> change the computer to use UTC after installation, edit the file
>> /etc/default/rcS, change the variable UTC to no". I thought if you
>> wanted use UTC you should set the variable UTC to yes, but it seems on
>> the other hand.
>
> Then the manual is in error. Read the man page rcS(5).
>
> Since you stated that Windows keeps correct time then your CMOS clock is
> set to localtime, not UTC, and /etc/default/rcS *should* read UTC=no.
>

It does not seems a configuration problem because, when a restart my ntp
service, after boot, in a minute or a couple of minutes I get the right
time. It seems a problem with ntp starting. At boot time, ntp starts (I
can see ntpd process with ps), but it seems it is not working as it
should be (when I type ntpq -q, it answers me theres is no association IDs).

Thanks.

From: Dave Uhring on
On Tue, 08 Apr 2008 09:33:43 +0200, Àngel Català wrote:

> It does not seems a configuration problem because, when a restart my ntp
> service, after boot, in a minute or a couple of minutes I get the right
> time. It seems a problem with ntp starting. At boot time, ntp starts (I
> can see ntpd process with ps), but it seems it is not working as it
> should be (when I type ntpq -q, it answers me theres is no association
> IDs).

Then perhaps you should hack your /etc/init.d/ntp script to run ntpdate
prior to starting the daemon.

But "ntpq -q", really? How about "ntpq -p"?
From: Àngel Català on
Dave Uhring escribiĂł:
> On Tue, 08 Apr 2008 09:33:43 +0200, Àngel Català wrote:
>
>> It does not seems a configuration problem because, when a restart my ntp
>> service, after boot, in a minute or a couple of minutes I get the right
>> time. It seems a problem with ntp starting. At boot time, ntp starts (I
>> can see ntpd process with ps), but it seems it is not working as it
>> should be (when I type ntpq -q, it answers me theres is no association
>> IDs).
>
> Then perhaps you should hack your /etc/init.d/ntp script to run ntpdate
> prior to starting the daemon.
>
> But "ntpq -q", really? How about "ntpq -p"?

Hehe, yes "ntpq -p" better :-))). It was just a typo.

I will try run ntpdate in /etc/init.d/ntp script

I will tell you the end of the story.

Thanks.
From: Chris Davies on
Ă€ngel CatalĂ  <ninguna(a)null.org> wrote:
> I have installed Debian 4.0 Etch r3 i386 in my laptop and I have a
> strange problem with clock setting with NTP that I can't solve by my self.

What kind of laptop?


> When I boot my laptop, my clock is always +2 hour over my current time.

I had a similar problem with my DELL, which was nothing to do with ntp
(other than it refusing to run because the time was so far off) and
the solution turned out to be to add "HWCLOCKPARS=--directisa" to the
/etc/default/rcS file.

You can confirm whether you need this fix by trying this command
(as root):

hwclock --show

If you get the message, "select() to /dev/rtc to wait for clock tick
timed out" try it again:

hwclock --show --directisa

If this works for you (returning within a second with a time) then you
need the fix.

Chris