You are not logged in.

#1 2009-03-05 12:43:58

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 688

[Solved] Stting the time correctly

OK I know that it's probably my fault, because I didn't do the tz at the install process, but I did it because the experience with it wasn't always the best. It did use wrong time on test machine even I configured it correctly, but then again I probably edited my rc.conf wrong.
Anyway now I'm trying to get my Arch to show the right time and I did a pretty stupid thing and edited my BIOS clock so that it shows my local time.
I'm re-reading the NTPD wiki article and I guess it will do the trick. But is there a way to get BIOS synced with time server?
Thanks!

Last edited by Primoz (2009-03-05 17:18:41)


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#2 2009-03-05 12:53:30

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [Solved] Stting the time correctly

It is very simple.
- use localtime and correct timezone in rc.conf
- reboot and set local time in BIOS
- back in Arch, run 'ntpdate pool.ntp.org' (should only differ by a few seconds, depending on what you used as source for BIOS time) and setup openntpd


1000

Offline

#3 2009-03-05 14:24:02

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: [Solved] Stting the time correctly

If your just using Linux (no windows) you can set it to UTC and use the BIOS time without altering it, ever. It has the upside of being .0000001 sec faster in boot time, as well as simplicity. On the other hand, if your BIOS does not adjust for daylight savings time on it's own, you're going to have to remember to switch it yourself.

That reminds me, I need to check on whither or not my BIOS adjusts this Saturday.

Thanks for the reminder!


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#4 2009-03-05 15:47:11

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [Solved] Stting the time correctly

i recommend setting bios to UTC, then setting timezone in rc.conf, then run ntpd in daemons to keep it all in sync.  also, you can put the following in /etc/rc.local:

# set the hwclock based on system time
hwclock --utc --hctosys

this will sync your BIOS time with your ntpd-adjusted system time at every boot.

Offline

#5 2009-03-05 17:00:38

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 688

Re: [Solved] Stting the time correctly

Sorry I forgot to change my BIOS clock to UTC. Will do this now and report back!
I guess I'm stupid or something I did what the ntpd wiki said and also did what brisbin33 advised, but my Clock is still one hour ahead.
I decided the best thing is to add my rc.conf, ntpd.conf and rc.local here so you can see if I added something wrong:
rc.conf:

HARDWARECLOCK="UTC"
TIMEZONE="Europe/Ljubljana"
...
DAEMONS=(syslog-ng network netfs crond alsa hal fam @openntpd kdm)

I checked the /var/log/daemon.log and it looks like it's doing the right thing, just it somehow doesn't translate in setting the time correctly:

Mar  5 17:48:15 abacus ntpd[2531]: set local clock to Thu Mar  5 17:48:15 CET 2009 (offset 82800.243380s

but the date gives this out:

date
Wed Mar  4 18:55:03 CET 2009

The whole 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 si.pool.ntp.org

rc.local (probably the problme lies here):

!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
# set the hwclock based on system time
hwclock --utc --hctosys

Last edited by Primoz (2009-03-05 17:09:48)


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#6 2009-03-05 17:10:51

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [Solved] Stting the time correctly

You don't need any manual fiddling with hwclock. Run ntpdate si.pool.ntp.org (ntpdate is in the ntp pkg) and keep an eye on daemon.log for a while. If all looks fine (no big leaps in the log and date output is correct), reboot and check again. There should be no problems.


1000

Offline

#7 2009-03-05 17:17:59

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 688

Re: [Solved] Stting the time correctly

No need ("the damage is done") I already changed my BIOS clock it was really problem in it, as it was on day behind, probably due to factory settings as it was probably made in USA.
Anyway thanks. I'll also use the ntpdate just to be sure big_smile.
I mark this solved!


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

#8 2009-03-05 17:39:02

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: [Solved] Stting the time correctly

probably due to factory settings as it was probably made in USA.

stop spreading lies. everyone in the world, except maybe you, knows the USA doesn't make much less export electronic goods.

hahah

Last edited by jacko (2009-03-05 17:40:21)

Offline

#9 2009-03-05 18:24:52

Primoz
Member
From: Ljubljana-Slovena-EU
Registered: 2009-03-04
Posts: 688

Re: [Solved] Stting the time correctly

jacko wrote:

probably due to factory settings as it was probably made in USA.

stop spreading lies. everyone in the world, except maybe you, knows the USA doesn't make much less export electronic goods.

hahah

OK you're right...
I don't really know why I wrote that even though it came to my mind that it probably was made in Taiwan big_smile
But BIOS was (probably) "made" in USA...
Well on the end it doesn't really matters...


Arch x86_64 ATI AMD APU KDE frameworks 5
---------------------------------
Whatever I do, I always end up with something horribly mis-configured.

Offline

Board footer

Powered by FluxBB