View previous topic :: View next topic |
Author |
Message |
jerrry94087 n00b
Joined: 02 Mar 2008 Posts: 41
|
Posted: Mon Mar 17, 2008 8:53 pm Post subject: /etc/conf.d/clock doesn;t set clock correctly |
|
|
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 |
|
|
Jimmy Jazz Guru
Joined: 04 Oct 2004 Posts: 325 Location: Strasbourg
|
Posted: Mon Mar 17, 2008 11:01 pm Post subject: Re: /etc/conf.d/clock doesn;t set clock correctly |
|
|
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 |
|
|
jerrry94087 n00b
Joined: 02 Mar 2008 Posts: 41
|
Posted: Wed Mar 19, 2008 6:15 am Post subject: |
|
|
I am sorry but your response about ntpdate doesn't have much to do with the essence of my question. |
|
Back to top |
|
|
Jimmy Jazz Guru
Joined: 04 Oct 2004 Posts: 325 Location: Strasbourg
|
Posted: Wed Mar 19, 2008 10:57 am Post subject: |
|
|
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 |
|
|
wjb l33t
Joined: 10 Jul 2005 Posts: 607 Location: Fife, Scotland
|
Posted: Wed Mar 19, 2008 8:57 pm Post subject: |
|
|
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 |
|
|
hoputa n00b
Joined: 17 Jan 2005 Posts: 12
|
Posted: Wed Mar 19, 2008 9:25 pm Post subject: |
|
|
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 |
|
|
|