Networking Forums

Networking Forums > Computer Networking > Linux Networking > Problem with Debian Etch and NTP

Reply
Thread Tools Display Modes

Problem with Debian Etch and NTP

 
 
Ŕngel Catalŕ
Guest
Posts: n/a

 
      04-05-2008, 11:03 AM
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.

I use NTP to sync clock, and I think NTP configuration is well done,
even time zones too.

When I boot my laptop, my clock is always +2 hour over my current time.
My ntpd is running, but when I type ntpq -p I get "No association ID's
returned" message.

So I restart ntpd and after a while I get my clock synchronized again,
so I understand that my configuration is OK, but I can't understand why
it does not work at boot time and it does after restart daemon manually.

By the way, after this, I can type ntpq -q and now I get the list of NTP
servers I have configured and its running data.

I will apreciate any help with this problem. If you need some of my
configuration files or any other info, please ask for them.

Many thanks.
 
Reply With Quote
 
 
 
 
Dave Uhring
Guest
Posts: n/a

 
      04-05-2008, 11:54 AM
On Sat, 05 Apr 2008 13:03:00 +0200, Ă€ngel CatalĂ* wrote:

> I use NTP to sync clock, and I think NTP configuration is well done,
> even time zones too.


NTP has nothing to do with time zones; it is always UTC.

> When I boot my laptop, my clock is always +2 hour over my current time.
> My ntpd is running, but when I type ntpq -p I get "No association ID's
> returned" message.


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.
 
Reply With Quote
 
Shadow_7
Guest
Posts: n/a

 
      04-05-2008, 12:53 PM
> So I restart ntpd and after a while I get my clock synchronized again,
> so I understand that my configuration is OK, but I can't understand why
> it does not work at boot time and it does after restart daemon manually.


Perhaps ntpd is launching before the network is up. I've had similar
problems with udev running too early if you disable other things like
dbus, autofs, and the likes. Adjust the /etc/rc?.d/S## for ntpd and see
if that helps. Higher numbers run later in the boot sequence.

There's other things for timezone / date stuff as well. So maybe that's
not quite right either. tzconfig, locales, /etc/timezone, /etc/localtime,
and various other things that need setting up as well. Is the computer
clock set to UTC or localtime? Are you rebooting to windows and it's
adjusting for DST without syncing to a server? Even though you already
adjusted for DST in linux.

I had a similar problem once. Although I didn't sync or run ntpd at all.
But every time my computer crashed, or otherwise shutdown without the use
of shutdown(power outage), the clock got bumped four hours. Perhaps your
computer is not shutting down right. All assumptions though as it's not
my computer and I don't know how you have things setup, or not.
 
Reply With Quote
 
Ă€ngel CatalĂ 
Guest
Posts: n/a

 
      04-07-2008, 06:46 AM
Dave Uhring escribiĂł:
> On Sat, 05 Apr 2008 13:03:00 +0200, Ă€ngel CatalĂ* wrote:
>
>> I use NTP to sync clock, and I think NTP configuration is well done,
>> even time zones too.

>
> NTP has nothing to do with time zones; it is always UTC.
>
>> When I boot my laptop, my clock is always +2 hour over my current time.
>> My ntpd is running, but when I type ntpq -p I get "No association ID's
>> returned" message.

>
> 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.


Hi Dave,

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

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.

Thanks for your answer.
 
Reply With Quote
 
Ă€ngel CatalĂ 
Guest
Posts: n/a

 
      04-07-2008, 06:50 AM
Shadow_7 escribiĂł:
>> So I restart ntpd and after a while I get my clock synchronized again,
>> so I understand that my configuration is OK, but I can't understand why
>> it does not work at boot time and it does after restart daemon manually.

>
> Perhaps ntpd is launching before the network is up. I've had similar
> problems with udev running too early if you disable other things like
> dbus, autofs, and the likes. Adjust the /etc/rc?.d/S## for ntpd and see
> if that helps. Higher numbers run later in the boot sequence.
>
> There's other things for timezone / date stuff as well. So maybe that's
> not quite right either. tzconfig, locales, /etc/timezone, /etc/localtime,
> and various other things that need setting up as well. Is the computer
> clock set to UTC or localtime? Are you rebooting to windows and it's
> adjusting for DST without syncing to a server? Even though you already
> adjusted for DST in linux.
>
> I had a similar problem once. Although I didn't sync or run ntpd at all.
> But every time my computer crashed, or otherwise shutdown without the use
> of shutdown(power outage), the clock got bumped four hours. Perhaps your
> computer is not shutting down right. All assumptions though as it's not
> my computer and I don't know how you have things setup, or not.


Hi,

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.

When I boot my laptop in Windows, the clock is OK, but when I boot with
Linux, I get this problem.

My runlevel is 2, so I look at rc2.d. In rc2.d I have S23ntp and after
that: S25bluetooth, S89anacron, S89atd, S89cron, S99acpi-support,
S99rc.local, etc. So ntp is starting quite late in my boot sequence.

Thanks for your answer.
 
Reply With Quote
 
Dave Uhring
Guest
Posts: n/a

 
      04-07-2008, 02:13 PM
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.

 
Reply With Quote
 
Ă€ngel CatalĂ 
Guest
Posts: n/a

 
      04-08-2008, 07:33 AM
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.

 
Reply With Quote
 
Dave Uhring
Guest
Posts: n/a

 
      04-08-2008, 11:25 AM
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"?
 
Reply With Quote
 
Ă€ngel CatalĂ 
Guest
Posts: n/a

 
      04-08-2008, 12:36 PM
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.
 
Reply With Quote
 
Chris Davies
Guest
Posts: n/a

 
      04-08-2008, 04:20 PM
Ă€ngel CatalĂ* <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with two network cards on Debian Etch bisbar@gmail.com Linux Networking 4 07-07-2007 08:35 AM
Problem with inews on Debian etch Laurens Kils-Huetten Linux Networking 0 06-21-2007 06:25 PM
Problem with dns in Debian Etch cantabile Linux Networking 0 05-18-2007 10:10 PM
Debian Etch, DEC 21041 NIC chip set Dave Boland Linux Networking 1 05-12-2007 07:31 PM
debian [testing/etch] redirected broadcasts not working mabra Linux Networking 2 02-19-2007 05:59 AM



1 2 3 4 5 6 7 8 9 10 11