Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
clock problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
interrupt storm
n00b
n00b


Joined: 06 May 2003
Posts: 13
Location: ames, iowa.. soon lille, france

PostPosted: Wed May 07, 2003 5:21 pm    Post subject: clock problems Reply with quote

i have an ibook 800 and i have my timezone set to chicago in both gentoo and os x. i have gentoo setup to use localtime and not utc in rc.conf, though i've tried utc and a bunch of other timezones. what happens is that my clock goes off by a few hours every time i boot into linux and then back into os x. i've tried setting my timezone to a few hours off, but then os x will just be off a different amount. i've tried syncing using rdate -s with a bunch of different time servers and while that works fine in linux, trying to sync the clock in os x sets the date to something crazy like 1936 and the time off by a few hours. before i loaded gentoo, the sync option in os x worked fine. i think i must have something configured wrong in linux or maybe there is an openfirmware option i need to change? i know the solution must probably be really simple, but i'm going crazy over this one. Can anybody please help?
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Wed May 07, 2003 9:48 pm    Post subject: Reply with quote

I have a similar problem, each reboot to the other OS I have wierd time in my clock.

my solution in linux: I set up ntp so that when ntp is started, it first runs rdate. (the setup necessary is in /etc/conf.d/ntp).

my solution in OS X: in 'Date & Time' in preferences, go to the 'Network Time' tab. put in a good stratum 2 time server. you can put multiple servers in the box, just separate them with a space. then push the 'Set Time Now' button. then make sure 'Use a network time server' is checked. that should do it.

One thing I need to look at: I just this morning received an email from a fellow ibook gentooer with the same problem ("Brian (Vond) Maloney"):

Quote:

Anyway, to "fix" it I just commented out the hwclock lines in /etc/init.d/clock. Something's broken there.


I haven't tried that yet.
Back to top
View user's profile Send private message
Vond
n00b
n00b


Joined: 04 May 2003
Posts: 20
Location: Osaka, Japan

PostPosted: Thu May 08, 2003 1:36 am    Post subject: Reply with quote

zojas wrote:
One thing I need to look at: I just this morning received an email from a fellow ibook gentooer with the same problem ("Brian (Vond) Maloney"):

Yeah, that's me. I couldn't rely on the NTP solution because I'm not always in a place with connectivity. Also, it was causing unnecessary fsck's the few times it set the clock to the year 2027.
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Thu May 08, 2003 1:58 am    Post subject: Reply with quote

yes. my 'default' runlevel starts up no networking services. once the system boots, I tell it which virtual runlevel to start up since I know which one is appropriate. if I have no network I have to run 'date' as root and set the clock by hand. :)
Back to top
View user's profile Send private message
genfoo
Apprentice
Apprentice


Joined: 17 Apr 2003
Posts: 192

PostPosted: Thu May 15, 2003 6:12 pm    Post subject: Reply with quote

set to use UTC in linux for your timezone, might clear things up as that's why OSX forcefully sets every time
Back to top
View user's profile Send private message
Vond
n00b
n00b


Joined: 04 May 2003
Posts: 20
Location: Osaka, Japan

PostPosted: Fri May 16, 2003 1:23 am    Post subject: Reply with quote

genfoo wrote:
set to use UTC in linux for your timezone, might clear things up as that's why OSX forcefully sets every time


I tried both Local and UTC, and neither worked. The clock got horribly skewed whenever it booted. Removing the hwclock lines fixed it. Has anyone else been able to confirm my findings?
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Fri May 16, 2003 2:59 pm    Post subject: Reply with quote

here's something interesting I found.

there are two hwclock lines in /etc/init.d/clock.

the first line invokes the 'adjust' function of hwclock.

the other sets the system clock from the hardware clock.

the adjust function is designed to correct for the drift of the hardware clock. the man page for hwclock describes this in detail (search for 'The Adjust Function') but the idea is that whenever the hardware clock is set from the system clock, hwclock remembers the adjustment necessary in /etc/adjtime. After that happens a few times, it calculates an adjustment factor. the adjustment factor gets applied to the hwclock as an offset when you invoke 'hwclock --adjust'.

you could see this could quickly become disasterous if an outside agent (like Mac OS X) is also adjusting the hardware clock.

when I first put linux on, I set the hardware clock to gmt, then later switched it to localtime since that's what OS X uses. right away, there's 7 hours worth of offset to screw things up with.

I've seen my clock be off anywhere from 35 minutes to 4.5 hours upon boot into linux.

so I'm going to try just commenting out the first hwclock line which invokes the adjust.
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Fri May 16, 2003 3:18 pm    Post subject: Reply with quote

well, that's sort of progress. I shut down completely, booted into OS X, and the clock was correct. but I saw in the /var/log/system.log that ntpdate adjusted the clock by 3600.something seconds. (1 hour). hmmm.

so then I shut down completely, then booted into linux. the clock was exactly 1 hour behind (should have been 8:15, but it was set to 7:15). I think this is the first time I've seen it be off exactly on an hour boundary though.

now I wonder if os x handles daylight savings time in a strange way. I live in phoenix, and we don't use daylight savings time (believe me, when it's 110°F (43.3°C) you WANT the sun to go down). right now our clocks read the same as pacific daylight time. the name of the time zone is still officially mountain standard time, and linux and os x both have timezone files for phoenix.

can someone who uses daylight savings time try this out? maybe I can look forward to this working for me this winter. :)
Back to top
View user's profile Send private message
Jaminadi
n00b
n00b


Joined: 24 Nov 2004
Posts: 24
Location: Boise, ID

PostPosted: Wed Nov 24, 2004 3:02 am    Post subject: The same problem... Reply with quote

I had the same problem with my computer clock. This post helped alot.
My solution was as follows.

1. Sync my clock
2. hwclock -w
3. rm /ect/adjtime
4. Sync my clock (optional)
5. hwclock -w

This should fix the divations if it is just a old config issue.
It has worked for me so far.
_________________
A woman is as a sword laid aside or a fire at a distance. THe one does not burn, the other does not cut those that approach not neigh unto them.
Back to top
View user's profile Send private message
rumcho
n00b
n00b


Joined: 12 Sep 2005
Posts: 4

PostPosted: Fri Sep 15, 2006 8:56 pm    Post subject: Look into /etc/conf.d/clock Reply with quote

in the /etc/conf.d/clock file change to:
CLOCK="local"
that should set you up.
Back to top
View user's profile Send private message
timotheus25
Apprentice
Apprentice


Joined: 27 Dec 2005
Posts: 162
Location: *upstate* New York, USA

PostPosted: Sat Sep 16, 2006 6:06 am    Post subject: Reply with quote

I use an Aluminum Powerbook, and have no time synchronization issue between the two OSs, even without networking. Using OS X 10.3.9 . (You should configure both for NTP just in case; OS X supports this under the Time control panel.)

You are supposed to use UTC time with OS X, and bidirectional synch'ing of the system/hardware clocks for proper maintenance of the clock.

Settings:
Code:

# cat /etc/conf.d/clock | grep -v '^#' | grep -v '^$'
CLOCK="UTC"
CLOCK_OPTS=""
CLOCK_SYSTOHC="yes"
SRM="no"
ARC="no"
# cat /etc/adjtime
cat /etc/adjtime
0.871725 1158298912 0.000000
1158298912
UTC
# /bin/ls -F -l /etc/localtime
lrwxrwxrwx 1 root root 38 2005-11-18 08:21 /etc/localtime -> ../usr/share/zoneinfo/America/New_York
# cat /etc/conf.d/ntp-client | grep -v '^#' | grep -v '^$'
NTPCLIENT_CMD="ntpdate"
NTPCLIENT_OPTS="-s -b -u pool.ntp.org"
NTPCLIENT_TIMEOUT=30


/etc/init.d/clock, /etc/init.d/ntp-client, are from baselayout 1.12.5, unmodified, both added to runlevel boot.

sys-libs/timezone-data-2006g
_________________
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Sat Sep 16, 2006 6:41 am    Post subject: Reply with quote

yes, it all works fine now. check the date of the last few posts. when I had this problem, it might have even been pre-jaguar os x. :lol:
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
timotheus25
Apprentice
Apprentice


Joined: 27 Dec 2005
Posts: 162
Location: *upstate* New York, USA

PostPosted: Sat Sep 16, 2006 7:16 am    Post subject: Reply with quote

Ah... I see now. :lol: A noob replied to an ancient post, and I followed suit. Oops.
_________________
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum