# ntpdate & local zone

## norguhtar

I'm got where intresting bug =) my settings :

```

*  net-misc/ntp

      Latest version available: 4.1.1b-r5

      Latest version installed: 4.1.1b-r5

      Size of downloaded files: 2,075 kB

      Homepage:    http://www.ntp.org/

      Description: Network Time Protocol suite/programs

```

```
 

ls -l /etc/localtime 

  /etc/localtime -> /usr/share/zoneinfo/Etc/GMT+5

```

```
 

 date

Sat May 17 14:42:01 GMT+5 2003

```

and 

```
 ntpdate -d 195.13.23.5 195.13.1.153 
```

I'm got (first line)! :

```

17 May 14:41:40 ntpdate[32645]: ntpdate 4.1.1b@1.829 Sat Apr 19 15:23:50 Local time zone must be set--see zic manual page 2003 (1)

```

Why i'm lost local zone in ntp ?

In rc.conf  

CLOCK="local" 

My version Gentoo 1.4rc1 with rsync portages  :Smile: 

```

```

----------

## SPo0n

works for me..

```
root@dillinja jamie # ntpdate

17 May 11:35:42 ntpdate[22023]: no servers can be used, exiting

root@dillinja jamie # ls -l /etc/localtime

lrwxrwxrwx    1 root     root           33 May  9 12:55 /etc/localtime -> /usr/share/zoneinfo/Europe/London

root@dillinja jamie # date

Sat May 17 11:35:58 BST 2003

root@dillinja jamie # ntpdate ntp.raketti.net

17 May 11:35:53 ntpdate[22026]: step time server 212.146.0.50 offset -20.187225 sec

root@dillinja jamie # 

```

----------

## Chris W

Curious, that works here too.

Can you read /etc/localtime?

Does /usr/share/zoneinfo/Etc/GMT+5 exist?

Have you recently upgraded or otherwise played with glibc?

----------

## norguhtar

 *Chris W wrote:*   

> Curious, that works here too.
> 
> 

 

 *Quote:*   

> 
> 
> Can you read /etc/localtime?
> 
> 

 

yes

 *Quote:*   

> 
> 
> Does /usr/share/zoneinfo/Etc/GMT+5 exist?
> 
> 

 

yes

 *Quote:*   

> 
> 
> Have you recently upgraded or otherwise played with glibc?

 

May be  :Smile:  glibc 2.3.1-r2 installed

----------

## Chris W

glibc owns the zoneinfo files.  glibc-2.3.1-r4 is the most recent stable one, and the one I have installed.  Perhaps 2.3.1-r2 is broken - the Changelog isn't enlightening.  Does your system match:

```

$ md5sum /usr/share/zoneinfo/Etc/GMT+5

0df2ef0f06aa7c2a1dbc3b13f4606c94  /usr/share/zoneinfo/Etc/GMT+5 
```

  I'm guessing this file is fairly static.

----------

## akarypid

Hi,

I have the same problem on a PC. Both "date" and "ntpdate" complain about zone info not being set with: Local time zone must be set--see zic manual page 2004.

```
blue root # date

Fri Nov 12 16:52:36 Local time zone must be set--see zic manual page 2004

blue root # ntpdate -d inf-server

12 Nov 16:53:26 ntpdate[31942]: ntpdate 4.2.0@1.1161-r Thu Nov 11 19:06:15 Local time zone must be set--see zic manual page 2004 (1)

...

blue root # emerge -s ^glibc

Searching...

[ Results for search key : ^glibc ]

[ Applications found : 1 ]

*  sys-libs/glibc

      Latest version available: 2.3.4.20040808-r1

      Latest version installed: 2.3.4.20040808-r1

...

```

I understand this message is printed by some standard library function. I re-emerged glibc and rebooted, but to no avail. I also re-emerged coreutils to which "date" belongs, but still the problem persists. I have this same version of glibc on two other PCs which work fine.

I think (not sure) that this may have been triggered by the fact that at some point I emerged glibc WITHOUT a /etc/timezone file. When I realized I had not set the time zone, I created a proper /etc/timezone file and checked the time with "date" which made me aware of the problem.

Any ideas?

----------

## revertex

i've got exactly the same problem a few days ago, check your symlink to /etc/timezone.

cheers

----------

## akarypid

Just replying to myself for other people's reference:

There was something wrong with /etc/localtime. Although it existed, it wasn't a symlink. I erased it and created a symlink as suggested in the Gentoo installation manual and all was fine.

By the way, while searching around for an answer, I came across references about the file /etc/timezone being used in the same manner. The correct file for glibc is /etc/localtime (as described in the manual) so make sure you're not mixing these up!  :Embarassed: 

----------

