Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Severe clock problems, setting by hand works, otherwise no.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Sat May 24, 2003 5:39 am    Post subject: Severe clock problems, setting by hand works, otherwise no. Reply with quote

When I first installed this gentoo machine, my clock was fine, no problems in the boot process, everything was fine.

The, all the sudden on one random boot, the "clock" script stopped working. As in, I had to ctrl+c it to continue booting. What is so odd about this that I had been working entirely in the console, and the only thing I had been doing the last 4 reboots or so, was recompiling my kernel and trying different configurations.

Any attempt to set the clock through KDE will freeze the clock applet, requiring a 'kill -9'. Much the same as the clock init script. However, if I use the "date" command on console, I can set the time without a problem. I know that the issue is in software because it works fine in windows XP, and the "date" command works fine as well. I have configured it properly, /etc/localtime is symlinked to EST which is my time zone, as per the install guide.

I attempted to "rc-update del clock default", it said the script was removed, but it still continued to run at bootup(possible bug?). Then, I completely removed the clock script from the init.d/ directory, but that causes more problems because metalog and dcron depend on it(Why, I don't know, because the system SHOULD be able to read the time from the bios without needing a clock script. I think that perhaps a reconfiguration of the init scripts could allow dcron and metalog to function without the clock script). However, I don't really know all that much, so I am unsure of how to fix it

I am at a loss for what I could have possibly done wrong, and I come to you begging for a solution. It has gotten to be quite the problem and I am sick of having to manually set my clock properly every time I need to reboot.

EDIT: god I wish gentoo was a commercial entity, I would LOVE to be able to purchase it and get phone tech support for it, I would not mind paying for it, even a monthly fee.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Sun May 25, 2003 10:00 pm    Post subject: Reply with quote

/etc/init.d/clock is just a little script that gets the CMOS clock info and puts it in the SYSTEM clock when it starts and doing the reverse when it stops.

You might want to open up /etc/init.d/clock in a text editor and manually do some of the stuff.

Also, try deleting /etc/adjtime.

try running:

Code:
/sbin/hwclock --utc
(if you have your CMOS clock set to UTC instead of local time... otherwise use --localtime.)
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Sun May 25, 2003 11:19 pm    Post subject: Reply with quote

tried it....

hwclock freezes as well.

The only time util that doesn't freeze is the date command.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
aaronjb
Tux's lil' helper
Tux's lil' helper


Joined: 25 May 2003
Posts: 106
Location: Berkshire, UK

PostPosted: Sun May 25, 2003 11:45 pm    Post subject: Re: Severe clock problems, setting by hand works, otherwise Reply with quote

revmoo wrote:
because the system SHOULD be able to read the time from the bios without needing a clock script.


Actually I'm not sure Linux can - that's the problem with a system that can run on multiple architectures.. Anyhow, moving on;

Did you recompile the kernel at all before this started happening - there are a few options in the kernel configs that control how the kernel accesses the RTC stuff - it could well be that the clock script (well, hwclock) is using stuff that's been changed?

Ok, probably not.. I'm just thinking aloud :) (while I wait for an emerge sync to finish, and listen to some Eric Clapton :D)

Aaron.
_________________
#my gentoo farm
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Mon May 26, 2003 1:07 am    Post subject: Reply with quote

Yes I did, but I did not run any of the kernels that I compiled until a while after this started happening......I was still running on the kernel that came with the install cd(thats another story) and it just started on a random bootup, nothing was changed.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Mon May 26, 2003 2:24 am    Post subject: Reply with quote

Code:
root@laureate:~# hwclock --debug --utc --test
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2003/05/26 02:24:14
Hw clock time : 2003/05/26 02:24:14 = 1053915854 seconds since 1969
Sun May 25 22:24:14 2003  -0.191628 seconds


Try posting yours.
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Mon May 26, 2003 5:49 pm    Post subject: Reply with quote

ok here's mine:

Code:

root@Moo revmoo # hwclock --debug --localtime --test
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Assuming hardware clock is kept in local time.
Waiting for clock tick...


...and then it just sits there.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon May 26, 2003 7:05 pm    Post subject: Reply with quote

Moved from Installing Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Thu May 29, 2003 1:44 am    Post subject: Reply with quote

Sorry to bump this topic, but I am on the verge of throwing my system out the window; I've been trying for almost two weeks now to fix my clock and I have no idea what to do, any help will be greatly appreciated.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Thu May 29, 2003 2:25 am    Post subject: Reply with quote

Try replacing the internal battery.
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Thu May 29, 2003 8:15 pm    Post subject: Reply with quote

It isn't a hardware issue.

The clock works fine under XP(and under slackware).

Besides, if the battery was dead, I would know it because I would lose my cmos values every reboot.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Fri May 30, 2003 1:35 am    Post subject: Reply with quote

How about the quartz crystals?

It sounds like the internal hardware clock isn't ticking anymore, which could mean that the quartz crystals are not working, either because they themselves are broken or that the electric current is not correct.

Replace the electrical clock with a clockwork one and see what happens...

But then again, if it works everywhere else, it must be the fault of your kernel... Try including RTC support. That would be under Character devices.
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

PostPosted: Fri May 30, 2003 3:16 am    Post subject: Reply with quote

CONFIG_RTC=y right?

It's set.

I have a hard time believing that its the crystal in the clock that is at fault, but in the event that it is, how do I get my clock script to work again?

I would imagine that I could just have it sync on boot with time.nist.gov or something, but I have no clue how to get the clock init script to work with that.
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Fri May 30, 2003 10:39 am    Post subject: Reply with quote

Quote:

BOFH Excuse #278:

The Dilithium Crystals need to be rotated.


Try removing RTC and see what happens.

As for the NTP sync, use ntpdate -b time.nist.gov
Back to top
View user's profile Send private message
revmoo
n00b
n00b


Joined: 12 May 2003
Posts: 32

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

hmm worth a shot...

Anyway, I understand how to SYNC my time, but that won't do a thing to fix the clock script that breaks on bootup. And since other init scripts(dcron, metalog) depend on the clock script, I will have to somehow modify it to not use my system's clock I would assume.....
_________________
Too much of a good thing is an awesome thing.
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Fri May 30, 2003 3:35 pm    Post subject: Reply with quote

well, i am experiencing exactly the same problems on my system. it works with slackware but it doesnt work with gentoo. but, interesting thing about this whole thing is, that it started drifting after some emerge -u world, so what i assume is, that we are having some severe problem in some package.

before some people start pointing my nose on the gadzillions of ntp/cronjob/ntpdate threads i need to say: i have read them all, but none of them solved my problem. currently i have ntpd installed and it runs (should run) by default. as i am having a perm. internet connection updating shouldn't be a problem but for some reason i still have major clock drift. when i do a /etc/init.d/ntpd restart the script spits out an error message stating ntpd isnt running but at least starts ntpd and sets the clock, well, the clock is set correctly then but drifting like hell. i am having about 5 hours clock drift per day... what sucks.

currently i ended up with setting a stupid cronjob that does a ntpdate every 20 minutes, but this isnt really sattisfying.

if anyone knows an answer, please post :)

cheers,
toskala
_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Sat May 31, 2003 1:15 am    Post subject: Reply with quote

This will only mask the problem. Find a permanant solution.

Code:

#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/clock,v 1.9 2002/11/04 14:51:07 azarah Exp $
 
 
depend() {
        need localmount
}
 
start() {
        local myopts=""
        local TBLURB=""
        local errstr=""
        if [ ! -f /etc/adjtime ]
        then
                echo "0.0 0 0.0" > /etc/adjtime
        fi
        if [ "${CLOCK}" = "UTC" ]
        then
                myopts="--utc"
                TBLURB="[UTC]"
        else
                myopts="--localtime"
                TBLURB="[Local Time]"
        fi
 
        if [ -x /sbin/hwclock ]
        then
                ebegin "Setting system clock to hardware clock ${TBLURB}"
                errstr="$(/sbin/hwclock --adjust ${myopts} 2>&1 >/dev/null)"
                errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"
                #hwclock do not return a fail status
                if [ -n "${errstr}" ]
                then
                        ewarn "Failed to set system clock to hardware clock" # eend 1 "Failed to set system clock to hardware clock"
                        return 0 # 1

                else
                        eend 0
                        return 0
                fi
        else
                eend 1 "hwclock executable not found"
        fi
}
 
stop() {
        local myopts=""
        local TBLURB=""
        local errstr=""
        if [ "${CLOCK}" = "UTC" ]
        then
                myopts="--utc"
                TBLURB="[UTC]"
        else
                myopts="--localtime"
                TBLURB="[Local Time]"
        fi
 
        if [ -x /sbin/hwclock ]
        then
                ebegin "Syncing hardware clock to system clock ${TBLURB}"
                errstr="$(/sbin/hwclock --systohc ${myopts} 2>&1 >/dev/null)"
                if [ -n "${errstr}" ]
                then
                        eend 1 "Failed to set hardware clock to system clock"
                        return 1
                else
                        eend 0
                        return 0
                fi
        else
                eend 1 "hwclock executable not found"
        fi
}
Back to top
View user's profile Send private message
Jura.nl
n00b
n00b


Joined: 31 May 2003
Posts: 6

PostPosted: Sun Jun 08, 2003 11:59 am    Post subject: Reply with quote

I've got that same problem. I'm running Gentoo and W2K on 1 machine here, and the clock is totaly screwed since gentoo got installed.

My thought is using the hardware clock in both OS's. I want to sync system to hardware on startup and not the other way around. (is this even possible) I set the clock to "local", but this was not the solution.

Any ideas??

Thanx
_________________
Be what u WANT to be, instead of the person you can be.
------------------------------------------------------------------
Gentoo Linux version 2.4.20-gaming-r3 KDE LILO
------------------------------------------------------------------
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Sun Jun 08, 2003 1:48 pm    Post subject: Reply with quote

Just a thought... have you tried re-emerging util-linux by any chance?

Also, if that doesn't work, you could attempt to use util-linux-2.11z-r4 instead; do a ACCEPT_KEYWORDS="~x86" emerge util-linux.

The only possible thing I can think of is that hwclock has someone been broken. I think you've tried everything else!
Back to top
View user's profile Send private message
thegiorgio
n00b
n00b


Joined: 16 Apr 2003
Posts: 11

PostPosted: Tue Jun 10, 2003 9:03 am    Post subject: My workaround Reply with quote

I took the --adjust off in /etc/init.d/clock and I have no longer clock problems. This --adjust setting is there to handle the "normal" drift that the CMOS clock produce because it is not 100% accurate but reading at the man page, this "normal drift" is enormous, far greater than any wrist clock that I ever used.

I think it is there because of old CMOS clock but nowadays, CMOS Clock are far more accurate than what is said in the man page.

So I took it off and wonderfully, I have no drift , even without ntp !
_________________
--
Giorgio
Back to top
View user's profile Send private message
drakk
n00b
n00b


Joined: 01 Jul 2003
Posts: 1

PostPosted: Sat Oct 04, 2003 10:14 pm    Post subject: clock Reply with quote

I'm on a laptop, my clock is working but only with <acpi=off> otherwise I get a lockup at boot when clock tries to sync with the hardware......any thoughts?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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