Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/conf.d/clock doesn;t set clock correctly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jerrry94087
n00b
n00b


Joined: 02 Mar 2008
Posts: 41

PostPosted: Mon Mar 17, 2008 8:53 pm    Post subject: /etc/conf.d/clock doesn;t set clock correctly Reply with quote

I have:
CLOCK="UTC"
TIMEZONE="America/Los_Angeles"

Afer I do 'ntpdate' 'date' shows correct time with PDT.
But when I reboot I see that BIOS clock is set not to the UTC but to PDT-1 for some reason.
After I reboot 'date' shows completely wrong time, shifted by 8 hours from what it was before reboot.

What is wrong?
Back to top
View user's profile Send private message
Jimmy Jazz
Apprentice
Apprentice


Joined: 04 Oct 2004
Posts: 274
Location: Strasbourg

PostPosted: Mon Mar 17, 2008 11:01 pm    Post subject: Re: /etc/conf.d/clock doesn;t set clock correctly Reply with quote

jerrry94087 wrote:
I have:
CLOCK="UTC"
TIMEZONE="America/Los_Angeles"

Afer I do 'ntpdate' 'date' shows correct time with PDT.
But when I reboot I see that BIOS clock is set not to the UTC but to PDT-1 for some reason.
After I reboot 'date' shows completely wrong time, shifted by 8 hours from what it was before reboot.

What is wrong?


Hi,

ntpdate is obsolete, use ntpd -x -q instead.

I had suddently the same problem with ntpd and it locked hard everytime ntpd -x -q was unable to synchronize. Tired, I switched from legacy ntpd to openntpd. It isn't as accurate as ntpd and doesn't support certificates (who cares ;) but works well in the same way as clockspeed. Above all it does not block the boot process.

Code:

# cat /etc/conf.d/ntpd
# /etc/conf.d/ntpd: config file for openntpd's ntpd

NTPD_HOME=/var/empty

# See ntpd(8) man page ... some popular options:
#  -s   Set the time immediately at startup
NTPD_OPTS="-s"
Code:

# cat /etc/ntpd.conf
# $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $
# sample ntpd configuration file, see ntpd.conf(5)

# Addresses to listen on (ntpd does not listen by default)
listen on *
#listen on 127.0.0.1
#listen on ::1

# sync to a single server
#server ntp.example.org

# use a random selection of 8 public stratum 2 servers
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
servers pool.ntp.org

Last but not least, do not forget to set your localtime,
Code:

# ls /etc/localtime  -l
lrwxrwxrwx 1 root root 38 Mar 10 10:46 /etc/localtime -> /usr/share/zoneinfo/America/Los_Angeles

_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
jerrry94087
n00b
n00b


Joined: 02 Mar 2008
Posts: 41

PostPosted: Wed Mar 19, 2008 6:15 am    Post subject: Reply with quote

I am sorry but your response about ntpdate doesn't have much to do with the essence of my question.
Back to top
View user's profile Send private message
Jimmy Jazz
Apprentice
Apprentice


Joined: 04 Oct 2004
Posts: 274
Location: Strasbourg

PostPosted: Wed Mar 19, 2008 10:57 am    Post subject: Reply with quote

jerrry94087 wrote:
I am sorry but your response about ntpdate doesn't have much to do with the essence of my question.


then i invite you to search out the probable response of your problem in the other lines :)

An other possibility, set TZ='your_time_zone' in 01timezone.
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
wjb
Guru
Guru


Joined: 10 Jul 2005
Posts: 356
Location: Fife, Scotland

PostPosted: Wed Mar 19, 2008 8:57 pm    Post subject: Reply with quote

In between reboots, if you were running a different operating system which thinks the h/w clock is localtime, and was doing its own time synchronisation then you'd get pretty much what you're seeing.
Back to top
View user's profile Send private message
hoputa
n00b
n00b


Joined: 17 Jan 2005
Posts: 12

PostPosted: Wed Mar 19, 2008 9:25 pm    Post subject: Reply with quote

I agree with previous post by wjb, that could very well be the problem.
In any case, to fix the wrong hw clock do this: set the time correctly (with ntp) and then run:

$ hwclock --systohc

That will set the hw clock correctly which should make your machine keep the time through reboots (until next time windoze is booted of course).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum