You are not logged in.

#1 2010-04-07 15:13:21

Caspian
Member
Registered: 2007-05-22
Posts: 263

[SOLVED]Time problem

For several days now, since the change to summer time, I'm having issues with correct time in Arch. The time is set to local, Europe/Zagreb timezone. Every time I shutdown the laptop I have wrong time (sometimes one hour later, sometimes 10 or 20 minutes), even when I change it with hwclock --set and then hwclock --hctosys. When I boot in Debian or Windows the time is always correct, but not in Arch.

Last edited by Caspian (2010-04-11 08:29:19)

Offline

#2 2010-04-07 15:28:07

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED]Time problem

openntp? Does it well enough for me...


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#3 2010-04-07 15:43:42

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

Re: [SOLVED]Time problem

Does removing /var/lib/hwclock/adjtime help?
How 'bout 'hwclock --systohc'?

Offline

#4 2010-04-07 16:08:51

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: [SOLVED]Time problem

Install an NTP program, if you haven't.

pacman -S openntpd


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

#5 2010-04-07 16:13:05

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED]Time problem

Offline

#6 2010-04-07 16:41:18

BarefootSoul83
Member
From: Virginia, USA
Registered: 2009-10-07
Posts: 110
Website

Re: [SOLVED]Time problem

run e2fsprogs in a shell before your partitions have mounted
it'll fix everything

Offline

#7 2010-04-07 17:08:47

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [SOLVED]Time problem

BarefootSoul83 wrote:

run e2fsprogs in a shell before your partitions have mounted
it'll fix everything

Hmmm..I am not sure you are saying what you think you are saying.
e2fsprogs is simply a package which contains ext2,3,4 filesystem utilities.

Offline

#8 2010-04-07 17:14:13

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

Re: [SOLVED]Time problem

I think he thinks it's about "your fs is mounted in the future" thing.
^D etc. etc.

Offline

#9 2010-04-07 17:25:42

daf666
Member
Registered: 2007-04-08
Posts: 470
Website

Re: [SOLVED]Time problem

Just a quick note to say that I am experienceing this same issue exactly.. (I dont have other OS'es on here so I didnt figure its an Arch issue)
Gonna try what was offered here.

Offline

#10 2010-04-07 17:27:04

BarefootSoul83
Member
From: Virginia, USA
Registered: 2009-10-07
Posts: 110
Website

Re: [SOLVED]Time problem

I had many time problems... e2fsprogs runs fsk or fdsk or something and fixed all my time problems.....

Offline

#11 2010-04-09 21:27:26

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: [SOLVED]Time problem

daf666 wrote:

Just a quick note to say that I am experienceing this same issue exactly.. (I dont have other OS'es on here so I didnt figure its an Arch issue)
Gonna try what was offered here.

Likewise I am having this problem as well.  I'm messing with it now.  I just noticed two instances of ntpd running one as a ntp and the other as root.  Looking into it.  If I find a way to fix it I will post an update.

Yes looks like a config problem in my case, from the log:

Apr  8 23:51:08 arch-desktop ntpd[2043]: adjtime failed: Invalid argument
Apr  8 23:54:00 arch-desktop ntpd[2043]: adjusting local clock by -3617.161147s
Apr  8 23:54:00 arch-desktop ntpd[2043]: adjtime failed: Invalid argument
Apr  9 00:33:53 arch-desktop ntpd[1887]: adjusting local clock by -5025.484174s
Apr  9 00:33:53 arch-desktop ntpd[1887]: adjtime failed: Invalid argument
Apr  9 00:37:05 arch-desktop ntpd[1887]: adjusting local clock by -5025.478283s
Apr  9 00:37:05 arch-desktop ntpd[1887]: adjtime failed: Invalid argument
Apr  9 00:37:18 arch-desktop ntpd[1887]: Terminating
Apr  9 02:03:29 arch-desktop ntpd[1887]: Terminating

I'll be messing with this tonight.

Last edited by davidm (2010-04-09 21:31:53)

Offline

#12 2010-04-09 22:07:41

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: [SOLVED]Time problem

NTP shouldn't be used to make large corrections like that, that's pretty poor advice. NTP is meant for minor changes to keep the clock in sync.

I've never had an issue with setting the clock through the BIOS. I used to have it set to UTC, and then had Archlinux correct it by supplying the timezone in /etc/rc.conf. However, with Windows, because it uses localtime, I had to switch my BIOS clock (well, Windows would do that for me) and /etc/rc.conf to use localtime.

Offline

#13 2010-04-09 22:14:49

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

Re: [SOLVED]Time problem

Thanks, Berticus - you reminded me that somebody sometime had some problems with time while dualbooting Arch + Win.

Time is like vodka - it flows nicely, you can't see it, but you can taste it ... only you call those little things 'hours' instead of 'shots' ;-P
Have a merry weekend everyone!

Offline

#14 2010-04-10 18:33:00

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: [SOLVED]Time problem

I had my /etc/rc.conf "TIMEZONE=EST" so I changed this to "TIMEZONE=US/Eastern".  I also had to manually update the BIOS clock.

I believe some of my problems started when trying to adjust things from within KDE when the time recently changed for spring when to my dismay it didn't change over automatically.  It appears that was likely due to the incorrect Timezone setting.

I am still noticing two instances of openntpd running:

ntp       1667  0.0  0.0   3364   716 ?        S    14:15   0:00 /usr/sbin/ntpd -s
root      1669  0.0  0.0   3468   496 ?        Ss   14:15   0:00 /usr/sbin/ntpd -s

Apparently this is the correct behavior:

Parent/Child

If you run the ps aux command when the daemon is running, you'll see two instances of ntpd running. One is the parent process owned by root and the other is the child process owned by a user such as _ntp. Two processes are required because when corrections need to be made to the local clock, the adjtime() function is called to do it. This function can only be performed by the root user. Also, the child cannot do DNS lookups since /etc/hosts and /etc/resolv.conf are outside the chroot.

http://netsecure.alcpress.com/openntpd/

It appeazrs that the errors:

Apr  9 00:37:05 arch-desktop ntpd[1887]: adjtime failed: Invalid argument

Came about in part because the clock was so far off from being set with the incorrect timezone.  Apparently such large changes are not handled automatically by ntpd unless using a special option ran manually.

So in my case the issue was multiple things.  I suspect the Original Poster might have issues due to similar reasons?  (Check your timezone setting in /etc/rc.conf).

Last edited by davidm (2010-04-10 20:23:55)

Offline

#15 2010-04-10 23:31:14

raj7095
Member
Registered: 2010-02-14
Posts: 91

Re: [SOLVED]Time problem

I recommend that you change the time from utc to localtime in rc.conf and set the correct time there.

Offline

#16 2010-04-11 08:28:52

Caspian
Member
Registered: 2007-05-22
Posts: 263

Re: [SOLVED]Time problem

I've deleted /var/lib/hwclock/adjtime (as karol posted) and this did the trick for me. Maybe it will help to all of you with similar problem. Thanks for all the replies.

Offline

#17 2010-04-11 11:56:31

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

Re: [SOLVED]Time problem

> I've deleted /var/lib/hwclock/adjtime (as karol posted) and this did the trick for me. Maybe it will help to all of you with similar problem.
> Thanks for all the replies.
It's already in the wiki, you only need to read up: http://wiki.archlinux.org/index.php/Time#Time_Skew
I'm happy you've got your problem fixed.

Edit: typo.

Last edited by karol (2010-04-11 12:00:19)

Offline

Board footer

Powered by FluxBB