[UCI-Linux] Re: problem with hwclock

Dirk Groeneveld dgroenev@uci.edu
Tue, 08 Oct 2002 17:23:12 -0700

I fixed it. What I did was, set the correct system date and time wih the 
date command, then execute hwclock --utc --systohc. That setup survived 
a reboot, and there's a hwclock --utc --hctosys in the gentoo startup 
scripts, so I think it's safe now, but I haven't touched the running 
system any further, and I am not going to until I have time to setup chrony.
I would be glad though, if anyone could tell my why this works.

Thank you, Joachim


Joachim Feise wrote:
> Dirk Groeneveld wrote:
>> Joachim Feise wrote:
>>  > Dirk Groeneveld wrote:
>>  >> I hope you can help me with this problem:
>>  >> My hardware clock is correctly set to UTC, but my system clock is,
>>  >> too, even after rebooting (especially after rebooting) or executing
>>  >> /etc/init.d/clock, which is supposed to set the system clock
>>  >> correctly. I traced the problem down to hwclock. hwclock --hctosys
>>  >> behaves exactly the same way as hwclock --hctosys --utc. TZ is not
>>  >> set, but setting it doesn't seem to make a difference. /etc/localtime
>>  >> points to /usr/share/zoneinfo/US/Pacific.
>>  > What are your parameters for clock?
>>  > My Slackware installation calls /sbin/clock -u -s at boot time.
>> I don't have /sbin/clock. I don't have any "clock" executable file on 
>> my system except for /etc/init.d/clock.
>> I forgot to mention: I use Gentoo Linux. So I looked in /usr/portage 
>> if there's a clock package, but found nothing.
> Well, I don't know anything about Gentoo.
> As far as clock is concerned, it is an older program, according to
> http://www.tldp.org/HOWTO/mini/Clock.html
> BTW, it is no surprise that hwclock --hctosys works the same with or 
> without
> --utc. The hwclock man page states that if --utc or --localtime is missing,
> hwclock uses whichever was used the last time.
> You may also have to look into adjtimex and the config file /etc/adjtime.
> In any case, I don't use either one. I'm running ntpd, which takes care
> of keeping the clock synchronized.