Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
Date: Mon, 06 Feb 2012 18:52:54
Message-Id: CA+czFiDHQGSr0Ud861CxeSo4xWYKGjRL+016dD0r5mOb2GQW0A@mail.gmail.com
In Reply to: Re: [gentoo-user] hwclock <--> sysclock and the ntp-client by Dale
1 On Mon, Feb 6, 2012 at 1:46 PM, Dale <rdalek1967@×××××.com> wrote:
2 > meino.cramer@×××.de wrote:
3 >> Hi,
4 >>
5 >> to get the correct system time I use ntp-client in the boot process.
6 >> Furthermore in /etc/conf.d/hwclock I set:
7 >>
8 >>     # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
9 >>     # Greenwich Mean Time).  If that clock is set to the local time, then
10 >>     # set CLOCK to "local".  Note that if you dual boot with Windows, then
11 >>     # you should set it to "local".
12 >>     clock="UTC"
13 >>
14 >>     # If you want to set the Hardware Clock to the current System Time
15 >>     # (software clock) during shutdown, then say "YES" here.
16 >>     # You normally don't need to do this if you run a ntp daemon.
17 >>     clock_systohc="YES"
18 >>
19 >>     # If you want to set the system time to the current hardware clock
20 >>     # during bootup, then say "YES" here. You do not need this if you are
21 >>     # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
22 >>     # Also, be aware that if you set this to "NO", the system time will
23 >>     # never be saved to the hardware clock unless you set
24 >>     # clock_systohc="YES" above.
25 >>     clock_hctosys="NO"
26 >>
27 >>     # If you wish to pass any other arguments to hwclock during bootup,
28 >>     # you may do so here. Alpha users may wish to use --arc or --srm here.
29 >>     clock_args=""
30 >>
31 >> In the kernel config file I had set:
32 >>
33 >>     CONFIG_RTC_HCTOSYS=y
34 >>     CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
35 >>
36 >> I would exspect that after a reboot of the system which system time is
37 >> correctly set via ntp-client that the hwclock and system time only
38 >> differ in a small amount of time.
39 >>
40 >> But:
41 >> solfire:/home/mccramer>hwclock
42 >> Mon Feb  6 19:05:11 2012  -0.172569 seconds
43 >> solfire:/home/mccramer>date
44 >> Mon Feb  6 18:49:37 CET 2012
45 >> solfire:/home/mccramer>
46 >>
47 >> Is there anything else which I have to tweak to acchieve what I want?
48 >>
49 >> Thank you very much in advance for any help!
50 >>
51 >> Best regards,
52 >> mcc
53 >>
54 >> PS: I need a correct hwclock since I want to wake the system via the
55 >> hwclock.
56 >>
57 >>
58 >>
59 >>
60 >
61 >
62 > I ran into some issues when I rebooted and I had to set both
63 > clock_systohc & clock_hctosys to yes.  That worked for me at least.  One
64 > sets the BIOS at shutdown and the other loads from the BIOS when
65 > rebooting.
66 >
67 > Yours may need something else but if nothing else works, try that.
68
69 I think he's trying to depend on the kernel keeping the hw clock in
70 sync with the sw clock, and that part's not working for some reason.
71
72 It's a reasonable thing to desire, since an unplanned or ungraceful
73 shutdown could miss the sw-to-hw step.
74
75 --
76 :wq