You are not logged in.

#1 2011-09-09 12:44:42

rg_arc
Member
Registered: 2011-03-20
Posts: 507

System time issues [SOLVED]

When I start up and log into Arch Linux, I've noticed that my time is initially off by about 5 hours. I have the ntp daemon enabled and I disabled the hwclock daemon:
/etc/rc.conf--

DAEMONS=(@syslog-ng alsa dbus @networkmanager ntpd @crond cupsd !hwclock slim)

After about 3-5 minutes the time is set correctly using ntp but I haven't been able to pinpoint why my time is initially off by 5 hours. When I freshly installed Arch Linux the time was working fine. My system is set to the right region and timezone, which I set correctly during installation, so I am not sure why the time isn't setup when I log in.

Any feedback would be much appreciated!

Last edited by rg_arc (2011-09-09 18:24:48)

Offline

#2 2011-09-09 13:08:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: System time issues [SOLVED]

What's the output of

egrep ^HARDWARECLOCK /etc/rc.conf
cat /var/lib/hwclock/adjtime

Offline

#3 2011-09-09 13:13:23

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

$ egrep ^HARDWARECLOCK /etc/rc.conf
HARDWARECLOCK="UTC"
$

$ cat /var/lib/hwclock/adjtime
607.229901 1314068793 0.000000
1314068793
UTC
$

Offline

#4 2011-09-09 13:18:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: System time issues [SOLVED]

You can remove /var/lib/hwclock/adjtime as the systematic drift (first number in the first line: 607.229901) is pretty big, over ten minutes.
What's the output of

# hwclock --debug

?

Offline

#5 2011-09-09 13:21:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,796

Re: System time issues [SOLVED]

Based on you English, I'll bet you live in the Center of the USA (Say around GMT-6 combined with daylight savings for a round 5 hour delta)

Either that, or your in the middle of Asia or the Indian ocean for a delta the other direction.

Your hardware clock is set to local time.  Look at the output of sudo hwclock -D


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2011-09-09 13:24:05

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

@karol

# hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/09/09 08:20:49
Hw clock time : 2011/09/09 08:20:49 = 1315574449 seconds since 1969
Fri 09 Sep 2011 08:20:49 AM CDT  -0.110099 seconds
# 

@ewaller

$ sudo hwclock -D
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/09/09 08:22:49
Hw clock time : 2011/09/09 08:22:49 = 1315574569 seconds since 1969
Fri 09 Sep 2011 08:22:49 AM CDT  -0.219801 seconds
$

Offline

#7 2011-09-09 13:26:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: System time issues [SOLVED]

Assuming hardware clock is kept in local time.

You can switch it from CDT to UTC and see what happens. Read https://wiki.archlinux.org/index.php/Time#Time_Standard

Last edited by karol (2011-09-09 13:27:08)

Offline

#8 2011-09-09 13:30:19

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

# hwclock --utc 
Fri 09 Sep 2011 03:28:35 AM CDT  -0.500485 seconds
#

This is exactly off by 5 hours... interesting

Offline

#9 2011-09-09 16:26:54

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

This is in my /etc/rc.conf file:

LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="America/Chicago"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

This is how it looked when I installed Arch Linux. I still don't understand why the hwclock keeps showing 5 hours off. My timezone is Central Time America/Chicago and I am using UTC...

On startup though... I've noticed right when Arch is checking / and /home partitions it says something like "time is off less than 24 hours.. probably because hwclock was set incorrectly.. FIXED" thats not exactly what it says but almost.

Offline

#10 2011-09-09 18:01:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,796

Re: System time issues [SOLVED]

Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/09/09 08:22:49

The hardware clock is set to local time, but the kernel thinks it is UTC, so it adds 5 hours.
Set you hardware clock to UTC


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2011-09-09 18:19:11

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

Would this be the correct command?

# hwclock --systohc --utc

rgedit: I think that fixed it

Last edited by rg_arc (2011-09-09 18:24:20)

Offline

#12 2011-09-09 19:22:58

cybertorture
Member
Registered: 2010-05-05
Posts: 339

Re: System time issues [SOLVED]

Just a opinion of mine:
" DAEMONS=(@syslog-ng alsa dbus @networkmanager ntpd @crond cupsd !hwclock slim) "
in my point of view, you want to start network in background ( do not wait for complete ) and you execute ntpd .... do not background "@" daemon if other daemon required it


O' rly ? Ya rly Oo

Offline

#13 2011-09-09 19:26:16

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: System time issues [SOLVED]

what about @ both of them? That is a good point though

Offline

#14 2011-09-09 20:42:46

cybertorture
Member
Registered: 2010-05-05
Posts: 339

Re: System time issues [SOLVED]

example:
@A @B != A B ( not always true ) if A finish load before B starts, it is fine .. but it is not that way always, so safe bet is remove "@" from networkmanager and put it on ntpd.


O' rly ? Ya rly Oo

Offline

Board footer

Powered by FluxBB