You are not logged in.

#26 2011-08-02 17:40:07

chakra-user
Member
Registered: 2010-03-07
Posts: 74

Re: clock out of sync again

Problem is I may not be connected to Internet always so can't and don't want to use NTP. I remember on a previous linux where ntp used to pause till socket timeout on startup. Not using Win7 and my bios does not have any UTC toggle. Point am trying to make is how to I have a pre-update setup back as before recent update of initscripts all was working well on my machine without additional jazz. Also does anyone know why hwclock is not running on startup and saving clock on shutdown? How do I confirm if it is working?

Last edited by chakra-user (2011-08-02 17:41:24)

Offline

#27 2011-08-02 18:07:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: clock out of sync again

hwclock only saves the time on shutdown I beleive.

also, its best you get on with the program with UTC, because pretty soon, TIMEZONE might not be supported in rc.conf anymore. You might still be able to use localtime, but it would just be a bit of hassle.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#28 2011-08-03 01:52:59

chakra-user
Member
Registered: 2010-03-07
Posts: 74

Re: clock out of sync again

Just want to understand how things were working fine on the same setup of mine prior to initscript update. One is the removal of a cron script that used to hwclock does anyone know whihc was it. I can put it back if it helps. What else has changed since last initscripts update?

Offline

#29 2011-08-03 03:23:35

Wittfella
Member
From: Australia
Registered: 2008-05-27
Posts: 462

Re: clock out of sync again

chakra-user wrote:

....I am not going to sit and calculate UTC time but going to see my watch and set the bios time...

Just following up on what Inxsible and Karol said, you don't have to manually calculate UTC time yourself when you want to set the date/time, thats silly, noone wants to do that, it does it for you automatically. 

Basically you just set the time to what you want, like now, same as the watch on your arm or the clock on the wall and if hwclock is set to UTC time the --systohc command will automatically do the calc for you.  eg.  You can do it right now to test out.  Format for the date command is MMDDhhmmCCYY

date 080311052011    <-- obviously use your correct date/time, I did this 3 August, 11:05 for instance.
hwclock -u --systohc

Now if you check the date and hwclock command they will be the same and correct.  BUT you say to yourself "WTF! I thought hwclock was supposed to be in UTC!"

It actually is but the straight hwclock command is automatically doing the timezone calc and showing it to you in your localtime.

If you do

hwclock --debug

you will see that the hardware/cmos/real clock is in UTC.

Last edited by Wittfella (2011-08-03 03:25:55)

Offline

#30 2011-08-03 15:50:40

chakra-user
Member
Registered: 2010-03-07
Posts: 74

Re: clock out of sync again

Thanks Wittfella, I did as you have said and it works fine. So far so good. But the problem I am trying to aim at is that the time in my Bios is some weird one as per UTC(currently showing 15:xx where as my localtime is 9:13 pm). As I mentioned that I am dual booting with Windows Vista and want localtime in my bios and Arch to manage it for me the way was doing till now. So basically, I want:

1. CMOS/Bios time will be in localtime.
2. Windows will pickup from it and work fine.
3. In Arch I will tell that the hardwareclock is in localtime so you directly use it in KDE/System Time. Chuck the UTC. I dont care.

Possible? How?

Last edited by chakra-user (2011-08-03 15:51:42)

Offline

#31 2011-08-04 04:22:37

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: clock out of sync again

i keep one of my machines in localtime and i'm having issues with it as well.  i think it's a bug in the initscripts, rc.sysinit is using the --systz parameter to set the system clock even if the hardware clock is set to localtime, when if i'm not mistaken, it should be using the --hctosys.

edit:
looks like that's not the issue, but something is definitely fucked up here.  i have two machines running arch, one uses localtime and the other utc.  i recently updated both of them (hadn't done so for about a month) and now my clocks are fucked up on both machines.  i've checked out my rc.conf files and everything looks correct there on both machines (i did update both from the pacnew file after the updates).
right now i'm about to use a live cd to bring up my machine that uses utc because it won't mount the root fs because of this bullshit..  as for my localtime machine the hwclock is correct but upon boot my system clock is set incorrectly.  i changed the line i thought was messing up the the system clock in rc.sysinit but it didn't work.

Last edited by e_tank (2011-08-04 04:50:15)

Offline

#32 2011-08-04 05:01:18

Wittfella
Member
From: Australia
Registered: 2008-05-27
Posts: 462

Re: clock out of sync again

Hey, I think you are on to something.  I just fooled around with it and --systz seems to assume that the hardware clock is always in UTC.  ie. if your HC is in localtime the --systz still applies your timezone correction and thus makes your system time wrong.  Using --hctosys works as expected in both UTC and localtime modes.

BUT then things got weird...

After setting my HC to localtime and doing the --systz test, the system date is wrong, checking with 'date'.  After a couple of seconds I did a 'date' command again, and WTF! its correct.  I repeated it a couple times to make sure.  After doing the --systz thing, time is wrong, wait ~4secs and then time is correct again.  No idea whats going on now...

Offline

#33 2011-08-04 07:08:59

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: clock out of sync again

i think the problem with my utc machine was that the hwclock daemon was screwing things up, so i disabled it, deleted my adjtime file, and reset the hwclock.  things seem to be fine now, i may try and re-enable the hwclock daemon later but for the moment i'd rather deal with any potential clock drift than have to continue messing around with my system on this.

as for my machine that's configured to use localtime, if i have the time i might tinker with it tomorrow to try figure out what's going on and how to fix it, i'll post back with results if/when i do.

@Wittfella: that's really odd, i don't recall my localtime machine doing anything like that.  are you running the hwclock daemon?  if so try disabling it.

Offline

#34 2011-08-05 21:52:48

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: clock out of sync again

although my clock is correct now @ LosAngeles timezone(at -8GMT +1 for daylight savings time = -7GMT),  its still stating this

$ hwclock --debug
hwclock from util-linux 2.19.1
Using /dev interface to clock.
Last drift adjustment done at 1312278515 seconds after 1969
Last calibration done at 1312278515 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/08/05 21:52:05
Hw clock time : 2011/08/05 21:52:05 = 1312606325 seconds since 1969
Fri 05 Aug 2011 09:52:05 PM PDT  -0.212007 seconds
$ date
Fri Aug  5 14:52:03 PDT 2011

Last edited by wolfdogg (2011-08-05 21:53:56)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

Board footer

Powered by FluxBB