# odd ntp problem

## truekaiser

recently for some odd reason ntp has been setting the clock exactly 1 day and 5 hours ahead of the actual time it is when the ntp-client init script is run no matter what timezone is selected. The only thing i changed in the ntp-client config file and the ntpd config file is to select closer servers.[/code]

edit:

it seems the system thinks the timezone for the local time is /usr/share/zoneinfo/America/North_Dakota/Center

instead of what is set for the system.

```

lrwxrwxrwx 1 root root 35 2009-03-25 02:08 /etc/localetime -> /usr/share/zoneinfo/America/Chicago

```

/etc/ntp.conf

```

# NOTES:

#  - you should only have to update the server line below

#  - if you start getting lines like 'restrict' and 'fudge'

#    and you didnt add them, AND you run dhcpcd on your

#    network interfaces, be sure to add '-Y -N' to the

#    dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with

# Please respect the access policy as stated by the responsible person.

#server      ntp.example.tld      iburst

# Common pool for random people

server 0.us.pool.ntp.org

server 1.us.pool.ntp.org

server 2.us.pool.ntp.org

server 3.us.pool.ntp.org

# Pools for Gentoo users

#server 0.gentoo.pool.ntp.org

#server 1.gentoo.pool.ntp.org

#server 2.gentoo.pool.ntp.org

#server 3.gentoo.pool.ntp.org

##

# A list of available servers can be found here:

# http://www.pool.ntp.org/

# http://www.pool.ntp.org/#use

# A good way to get servers for your machine is:

# netselect -s 3 pool.ntp.org

##

# you should not need to modify the following paths

driftfile   /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer 

#server timeserver.example.org 

# Warning: Using default NTP settings will leave your NTP

# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)

# from accessing the NTP server, uncomment:

#restrict default ignore

# To deny other machines from changing the

# configuration but allow localhost:

restrict default nomodify nopeer

restrict 127.0.0.1

# To allow machines within your network to synchronize

# their clocks with your server, but ensure they are

# not allowed to configure the server or used as peers

# to synchronize against, uncomment this line.

#

#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap

```

/etc/config.d/ntp

```

# /etc/conf.d/ntpd

# Options to pass to the ntpd process

# Most people should leave this line alone ...

# however, if you know what you're doing, feel free to tweak

NTPD_OPTS=""

```

/etc/config.d/ntp-client

```

# /etc/conf.d/ntp-client

# Command to run to set the clock initially

# Most people should just leave this line alone ...

# however, if you know what you're doing, and you

# want to use ntpd to set the clock, change this to 'ntpd'

NTPCLIENT_CMD="ntpdate"

# Options to pass to the above command

# This default setting should work fine but you should

# change the default 'pool.ntp.org' to something closer

# to your machine.  See http://www.pool.ntp.org/ or

# try running `netselect -s 3 pool.ntp.org`.

NTPCLIENT_OPTS="-s -b -u \

   70.86.250.6 72.232.250.202 \

   65.254.214.170"

```

/etc/conf.d/clock

```

# /etc/conf.d/clock

# Set CLOCK to "UTC" if your system clock is set to UTC (also known as

# Greenwich Mean Time).  If your clock is set to the local time, then 

# set CLOCK to "local".  Note that if you dual boot with Windows, then 

# you should set it to "local".

CLOCK="local"

# Select the proper timezone.  For valid values, peek inside of the

# /usr/share/zoneinfo/ directory.  For example, some common values are

# "America/New_York" or "EST5EDT" or "Europe/Berlin".

TIMEZONE="America/Chicago"

# If you wish to pass any other arguments to hwclock during bootup, 

# you may do so here.

CLOCK_OPTS=""

# If you want to set the Hardware Clock to the current System Time 

# during shutdown, then say "yes" here.

CLOCK_SYSTOHC="yes"

### ALPHA SPECIFIC OPTIONS ###

# If your alpha uses the SRM console, set this to "yes".

SRM="no"

# If your alpha uses the ARC console, set this to "yes".

ARC="no"

```

----------

## truekaiser

So no one else is having a issue like this?

----------

## mijenix

Yes, me too on a AMD64 arch.

1 hour drift from the local time.

But I get a error on boot from hwclock that it can't access the bios clock.

hwclock --debug says:

hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.

I've set CONFIG_RTC=y, CONFIG_HPET_EMULATE_RTC=y and CONFIG_HPET_RTC_IRQ=y

----------

## truekaiser

i get this.

```

hwclock from util-linux-ng 2.14.1

Using /dev interface to clock.

Last drift adjustment done at 1237981249 seconds after 1969

Last calibration done at 1237981249 seconds after 1969

Hardware clock is on local time

Assuming hardware clock is kept in local time.

Waiting for clock tick...

...got clock tick

Time read from Hardware Clock: 2009/03/25 16:45:05

Hw clock time : 2009/03/25 16:45:05 = 1237999505 seconds since 1969

Wed 25 Mar 2009 04:45:05 PM UTC  -0.342282 seconds

```

i would love to have ntp working again i can get the clock close to the correct time but it drifts by a few minutes.

----------

## hvengel

In /etc/conf.d/ntp try

NTPD_OPTS="--panicgate" 

If this is not set and your clock is off by more than 10 seconds ntp will abort and not run.

----------

## cyrillic

 *truekaiser wrote:*   

> it seems the system thinks the timezone for the local time is /usr/share/zoneinfo/America/North_Dakota/Center
> 
> instead of what is set for the system.
> 
> ```
> ...

 

Check to see if it is just a typo in this post.

It should be spelled "/etc/localtime".

----------

## V-Li

I had problems with NTP some time ago and switched to OpenNTPd, which works like a charm for years now.

----------

