* [gentoo-user] hwclock <--> sysclock and the ntp-client
@ 2012-02-06 17:51 meino.cramer
2012-02-06 18:11 ` Michael Mol
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: meino.cramer @ 2012-02-06 17:51 UTC (permalink / raw
To: Gentoo
Hi,
to get the correct system time I use ntp-client in the boot process.
Furthermore in /etc/conf.d/hwclock I set:
# Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
# Greenwich Mean Time). If that clock is set to the local time, then
# set CLOCK to "local". Note that if you dual boot with Windows, then
# you should set it to "local".
clock="UTC"
# If you want to set the Hardware Clock to the current System Time
# (software clock) during shutdown, then say "YES" here.
# You normally don't need to do this if you run a ntp daemon.
clock_systohc="YES"
# If you want to set the system time to the current hardware clock
# during bootup, then say "YES" here. You do not need this if you are
# running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
# Also, be aware that if you set this to "NO", the system time will
# never be saved to the hardware clock unless you set
# clock_systohc="YES" above.
clock_hctosys="NO"
# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here. Alpha users may wish to use --arc or --srm here.
clock_args=""
In the kernel config file I had set:
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
I would exspect that after a reboot of the system which system time is
correctly set via ntp-client that the hwclock and system time only
differ in a small amount of time.
But:
solfire:/home/mccramer>hwclock
Mon Feb 6 19:05:11 2012 -0.172569 seconds
solfire:/home/mccramer>date
Mon Feb 6 18:49:37 CET 2012
solfire:/home/mccramer>
Is there anything else which I have to tweak to acchieve what I want?
Thank you very much in advance for any help!
Best regards,
mcc
PS: I need a correct hwclock since I want to wake the system via the
hwclock.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 17:51 [gentoo-user] hwclock <--> sysclock and the ntp-client meino.cramer
@ 2012-02-06 18:11 ` Michael Mol
2012-02-06 18:39 ` meino.cramer
2012-02-06 18:46 ` Dale
2012-02-08 14:45 ` [gentoo-user] " James
2 siblings, 1 reply; 15+ messages in thread
From: Michael Mol @ 2012-02-06 18:11 UTC (permalink / raw
To: gentoo-user
On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
> Hi,
>
> to get the correct system time I use ntp-client in the boot process.
> Furthermore in /etc/conf.d/hwclock I set:
>
> # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
> # Greenwich Mean Time). If that clock is set to the local time, then
> # set CLOCK to "local". Note that if you dual boot with Windows, then
> # you should set it to "local".
> clock="UTC"
>
> # If you want to set the Hardware Clock to the current System Time
> # (software clock) during shutdown, then say "YES" here.
> # You normally don't need to do this if you run a ntp daemon.
> clock_systohc="YES"
>
> # If you want to set the system time to the current hardware clock
> # during bootup, then say "YES" here. You do not need this if you are
> # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> # Also, be aware that if you set this to "NO", the system time will
> # never be saved to the hardware clock unless you set
> # clock_systohc="YES" above.
> clock_hctosys="NO"
>
> # If you wish to pass any other arguments to hwclock during bootup,
> # you may do so here. Alpha users may wish to use --arc or --srm here.
> clock_args=""
>
> In the kernel config file I had set:
>
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>
> I would exspect that after a reboot of the system which system time is
> correctly set via ntp-client that the hwclock and system time only
> differ in a small amount of time.
>
> But:
> solfire:/home/mccramer>hwclock
> Mon Feb 6 19:05:11 2012 -0.172569 seconds
> solfire:/home/mccramer>date
> Mon Feb 6 18:49:37 CET 2012
> solfire:/home/mccramer>
I don't know the CET tz, but I can see that the minutes don't match
up. I assume you rand the two commands within seconds of each other.
Is this true immediately after bootup, or does it take a while to get
that far off? It could be that your hardware clock is drifting, and
the system won't reset it until it goes to shutdown.
--
:wq
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:11 ` Michael Mol
@ 2012-02-06 18:39 ` meino.cramer
2012-02-06 18:48 ` Michael Mol
2012-02-06 18:52 ` Florian Philipp
0 siblings, 2 replies; 15+ messages in thread
From: meino.cramer @ 2012-02-06 18:39 UTC (permalink / raw
To: gentoo-user
Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
> > Hi,
> >
> > to get the correct system time I use ntp-client in the boot process.
> > Furthermore in /etc/conf.d/hwclock I set:
> >
> > # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
> > # Greenwich Mean Time). If that clock is set to the local time, then
> > # set CLOCK to "local". Note that if you dual boot with Windows, then
> > # you should set it to "local".
> > clock="UTC"
> >
> > # If you want to set the Hardware Clock to the current System Time
> > # (software clock) during shutdown, then say "YES" here.
> > # You normally don't need to do this if you run a ntp daemon.
> > clock_systohc="YES"
> >
> > # If you want to set the system time to the current hardware clock
> > # during bootup, then say "YES" here. You do not need this if you are
> > # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> > # Also, be aware that if you set this to "NO", the system time will
> > # never be saved to the hardware clock unless you set
> > # clock_systohc="YES" above.
> > clock_hctosys="NO"
> >
> > # If you wish to pass any other arguments to hwclock during bootup,
> > # you may do so here. Alpha users may wish to use --arc or --srm here.
> > clock_args=""
> >
> > In the kernel config file I had set:
> >
> > CONFIG_RTC_HCTOSYS=y
> > CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> >
> > I would exspect that after a reboot of the system which system time is
> > correctly set via ntp-client that the hwclock and system time only
> > differ in a small amount of time.
> >
> > But:
> > solfire:/home/mccramer>hwclock
> > Mon Feb 6 19:05:11 2012 -0.172569 seconds
> > solfire:/home/mccramer>date
> > Mon Feb 6 18:49:37 CET 2012
> > solfire:/home/mccramer>
>
> I don't know the CET tz, but I can see that the minutes don't match
> up. I assume you rand the two commands within seconds of each other.
> Is this true immediately after bootup, or does it take a while to get
> that far off? It could be that your hardware clock is drifting, and
> the system won't reset it until it goes to shutdown.
>
> --
> :wq
>
Hi Michael,
thank you for your reply.
I set the configuration as mentioned above and booted twice with about
five minutes wait.
The commands were executed within seconds, yes.
All hardware clocks drifts, but this is not the problem.
The problem is that the hardware clock is not set to the system time
in contradiction to what I think the comments in the config are
saying.
How can I fix that?
Thank you very much in advance for any help!
Best regards,
mcc
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 17:51 [gentoo-user] hwclock <--> sysclock and the ntp-client meino.cramer
2012-02-06 18:11 ` Michael Mol
@ 2012-02-06 18:46 ` Dale
2012-02-06 18:50 ` Michael Mol
2012-02-08 14:45 ` [gentoo-user] " James
2 siblings, 1 reply; 15+ messages in thread
From: Dale @ 2012-02-06 18:46 UTC (permalink / raw
To: gentoo-user
meino.cramer@gmx.de wrote:
> Hi,
>
> to get the correct system time I use ntp-client in the boot process.
> Furthermore in /etc/conf.d/hwclock I set:
>
> # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
> # Greenwich Mean Time). If that clock is set to the local time, then
> # set CLOCK to "local". Note that if you dual boot with Windows, then
> # you should set it to "local".
> clock="UTC"
>
> # If you want to set the Hardware Clock to the current System Time
> # (software clock) during shutdown, then say "YES" here.
> # You normally don't need to do this if you run a ntp daemon.
> clock_systohc="YES"
>
> # If you want to set the system time to the current hardware clock
> # during bootup, then say "YES" here. You do not need this if you are
> # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> # Also, be aware that if you set this to "NO", the system time will
> # never be saved to the hardware clock unless you set
> # clock_systohc="YES" above.
> clock_hctosys="NO"
>
> # If you wish to pass any other arguments to hwclock during bootup,
> # you may do so here. Alpha users may wish to use --arc or --srm here.
> clock_args=""
>
> In the kernel config file I had set:
>
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>
> I would exspect that after a reboot of the system which system time is
> correctly set via ntp-client that the hwclock and system time only
> differ in a small amount of time.
>
> But:
> solfire:/home/mccramer>hwclock
> Mon Feb 6 19:05:11 2012 -0.172569 seconds
> solfire:/home/mccramer>date
> Mon Feb 6 18:49:37 CET 2012
> solfire:/home/mccramer>
>
> Is there anything else which I have to tweak to acchieve what I want?
>
> Thank you very much in advance for any help!
>
> Best regards,
> mcc
>
> PS: I need a correct hwclock since I want to wake the system via the
> hwclock.
>
>
>
>
I ran into some issues when I rebooted and I had to set both
clock_systohc & clock_hctosys to yes. That worked for me at least. One
sets the BIOS at shutdown and the other loads from the BIOS when
rebooting.
Yours may need something else but if nothing else works, try that.
Dale
:-) :-)
--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!
Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:39 ` meino.cramer
@ 2012-02-06 18:48 ` Michael Mol
2012-02-06 23:57 ` meino.cramer
2012-02-06 18:52 ` Florian Philipp
1 sibling, 1 reply; 15+ messages in thread
From: Michael Mol @ 2012-02-06 18:48 UTC (permalink / raw
To: gentoo-user
On Mon, Feb 6, 2012 at 1:39 PM, <meino.cramer@gmx.de> wrote:
> Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
>> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
>> > Hi,
>> >
>> > to get the correct system time I use ntp-client in the boot process.
>> > Furthermore in /etc/conf.d/hwclock I set:
>> >
>> > # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
>> > # Greenwich Mean Time). If that clock is set to the local time, then
>> > # set CLOCK to "local". Note that if you dual boot with Windows, then
>> > # you should set it to "local".
>> > clock="UTC"
>> >
>> > # If you want to set the Hardware Clock to the current System Time
>> > # (software clock) during shutdown, then say "YES" here.
>> > # You normally don't need to do this if you run a ntp daemon.
>> > clock_systohc="YES"
>> >
>> > # If you want to set the system time to the current hardware clock
>> > # during bootup, then say "YES" here. You do not need this if you are
>> > # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
>> > # Also, be aware that if you set this to "NO", the system time will
>> > # never be saved to the hardware clock unless you set
>> > # clock_systohc="YES" above.
>> > clock_hctosys="NO"
>> >
>> > # If you wish to pass any other arguments to hwclock during bootup,
>> > # you may do so here. Alpha users may wish to use --arc or --srm here.
>> > clock_args=""
>> >
>> > In the kernel config file I had set:
>> >
>> > CONFIG_RTC_HCTOSYS=y
>> > CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>> >
>> > I would exspect that after a reboot of the system which system time is
>> > correctly set via ntp-client that the hwclock and system time only
>> > differ in a small amount of time.
>> >
>> > But:
>> > solfire:/home/mccramer>hwclock
>> > Mon Feb 6 19:05:11 2012 -0.172569 seconds
>> > solfire:/home/mccramer>date
>> > Mon Feb 6 18:49:37 CET 2012
>> > solfire:/home/mccramer>
>>
>> I don't know the CET tz, but I can see that the minutes don't match
>> up. I assume you rand the two commands within seconds of each other.
>> Is this true immediately after bootup, or does it take a while to get
>> that far off? It could be that your hardware clock is drifting, and
>> the system won't reset it until it goes to shutdown.
>>
>> --
>> :wq
>>
>
> Hi Michael,
> thank you for your reply.
> I set the configuration as mentioned above and booted twice with about
> five minutes wait.
> The commands were executed within seconds, yes.
> All hardware clocks drifts, but this is not the problem.
> The problem is that the hardware clock is not set to the system time
> in contradiction to what I think the comments in the config are
> saying.
>
> How can I fix that?
I don't really know. Are you sure that rtc0 corresponds to your
hardware clock device? Does setting "clock_hctosys" to YES have any
effect?
Is this in some kind of virtual-machine or hypervised environment
where something may be blocking the OS from setting the hardware
clock?
--
:wq
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:46 ` Dale
@ 2012-02-06 18:50 ` Michael Mol
0 siblings, 0 replies; 15+ messages in thread
From: Michael Mol @ 2012-02-06 18:50 UTC (permalink / raw
To: gentoo-user
On Mon, Feb 6, 2012 at 1:46 PM, Dale <rdalek1967@gmail.com> wrote:
> meino.cramer@gmx.de wrote:
>> Hi,
>>
>> to get the correct system time I use ntp-client in the boot process.
>> Furthermore in /etc/conf.d/hwclock I set:
>>
>> # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
>> # Greenwich Mean Time). If that clock is set to the local time, then
>> # set CLOCK to "local". Note that if you dual boot with Windows, then
>> # you should set it to "local".
>> clock="UTC"
>>
>> # If you want to set the Hardware Clock to the current System Time
>> # (software clock) during shutdown, then say "YES" here.
>> # You normally don't need to do this if you run a ntp daemon.
>> clock_systohc="YES"
>>
>> # If you want to set the system time to the current hardware clock
>> # during bootup, then say "YES" here. You do not need this if you are
>> # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
>> # Also, be aware that if you set this to "NO", the system time will
>> # never be saved to the hardware clock unless you set
>> # clock_systohc="YES" above.
>> clock_hctosys="NO"
>>
>> # If you wish to pass any other arguments to hwclock during bootup,
>> # you may do so here. Alpha users may wish to use --arc or --srm here.
>> clock_args=""
>>
>> In the kernel config file I had set:
>>
>> CONFIG_RTC_HCTOSYS=y
>> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>>
>> I would exspect that after a reboot of the system which system time is
>> correctly set via ntp-client that the hwclock and system time only
>> differ in a small amount of time.
>>
>> But:
>> solfire:/home/mccramer>hwclock
>> Mon Feb 6 19:05:11 2012 -0.172569 seconds
>> solfire:/home/mccramer>date
>> Mon Feb 6 18:49:37 CET 2012
>> solfire:/home/mccramer>
>>
>> Is there anything else which I have to tweak to acchieve what I want?
>>
>> Thank you very much in advance for any help!
>>
>> Best regards,
>> mcc
>>
>> PS: I need a correct hwclock since I want to wake the system via the
>> hwclock.
>>
>>
>>
>>
>
>
> I ran into some issues when I rebooted and I had to set both
> clock_systohc & clock_hctosys to yes. That worked for me at least. One
> sets the BIOS at shutdown and the other loads from the BIOS when
> rebooting.
>
> Yours may need something else but if nothing else works, try that.
I think he's trying to depend on the kernel keeping the hw clock in
sync with the sw clock, and that part's not working for some reason.
It's a reasonable thing to desire, since an unplanned or ungraceful
shutdown could miss the sw-to-hw step.
--
:wq
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:39 ` meino.cramer
2012-02-06 18:48 ` Michael Mol
@ 2012-02-06 18:52 ` Florian Philipp
2012-02-07 0:00 ` meino.cramer
1 sibling, 1 reply; 15+ messages in thread
From: Florian Philipp @ 2012-02-06 18:52 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3200 bytes --]
Am 06.02.2012 19:39, schrieb meino.cramer@gmx.de:
> Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
>> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
>>> Hi,
>>>
>>> to get the correct system time I use ntp-client in the boot process.
>>> Furthermore in /etc/conf.d/hwclock I set:
>>>
>>> # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
>>> # Greenwich Mean Time). If that clock is set to the local time, then
>>> # set CLOCK to "local". Note that if you dual boot with Windows, then
>>> # you should set it to "local".
>>> clock="UTC"
>>>
>>> # If you want to set the Hardware Clock to the current System Time
>>> # (software clock) during shutdown, then say "YES" here.
>>> # You normally don't need to do this if you run a ntp daemon.
>>> clock_systohc="YES"
>>>
>>> # If you want to set the system time to the current hardware clock
>>> # during bootup, then say "YES" here. You do not need this if you are
>>> # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
>>> # Also, be aware that if you set this to "NO", the system time will
>>> # never be saved to the hardware clock unless you set
>>> # clock_systohc="YES" above.
>>> clock_hctosys="NO"
>>>
>>> # If you wish to pass any other arguments to hwclock during bootup,
>>> # you may do so here. Alpha users may wish to use --arc or --srm here.
>>> clock_args=""
>>>
>>> In the kernel config file I had set:
>>>
>>> CONFIG_RTC_HCTOSYS=y
>>> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>>>
>>> I would exspect that after a reboot of the system which system time is
>>> correctly set via ntp-client that the hwclock and system time only
>>> differ in a small amount of time.
>>>
>>> But:
>>> solfire:/home/mccramer>hwclock
>>> Mon Feb 6 19:05:11 2012 -0.172569 seconds
>>> solfire:/home/mccramer>date
>>> Mon Feb 6 18:49:37 CET 2012
>>> solfire:/home/mccramer>
>>
>> I don't know the CET tz, but I can see that the minutes don't match
>> up. I assume you rand the two commands within seconds of each other.
>> Is this true immediately after bootup, or does it take a while to get
>> that far off? It could be that your hardware clock is drifting, and
>> the system won't reset it until it goes to shutdown.
>>
>> --
>> :wq
>>
>
> Hi Michael,
> thank you for your reply.
> I set the configuration as mentioned above and booted twice with about
> five minutes wait.
> The commands were executed within seconds, yes.
> All hardware clocks drifts, but this is not the problem.
> The problem is that the hardware clock is not set to the system time
> in contradiction to what I think the comments in the config are
> saying.
>
> How can I fix that?
>
> Thank you very much in advance for any help!
> Best regards,
> mcc
>
>
>
Is your RTC driver compiled into the kernel? The "httosys" function of
the kernel takes place before any modules can be loaded and will fail if
your CMOS clock driver is a module.
Activating clock_hctosys in /etc/conf.d/hwclock should solve this as it
takes place later in the boot process.
Regards,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:48 ` Michael Mol
@ 2012-02-06 23:57 ` meino.cramer
2012-02-07 1:02 ` Michael Mol
0 siblings, 1 reply; 15+ messages in thread
From: meino.cramer @ 2012-02-06 23:57 UTC (permalink / raw
To: gentoo-user
Michael Mol <mikemol@gmail.com> [12-02-06 19:56]:
> On Mon, Feb 6, 2012 at 1:39 PM, <meino.cramer@gmx.de> wrote:
> > Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
> >> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
> >> > Hi,
> >> >
> >> > to get the correct system time I use ntp-client in the boot process.
> >> > Furthermore in /etc/conf.d/hwclock I set:
> >> >
> >> > # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
> >> > # Greenwich Mean Time). If that clock is set to the local time, then
> >> > # set CLOCK to "local". Note that if you dual boot with Windows, then
> >> > # you should set it to "local".
> >> > clock="UTC"
> >> >
> >> > # If you want to set the Hardware Clock to the current System Time
> >> > # (software clock) during shutdown, then say "YES" here.
> >> > # You normally don't need to do this if you run a ntp daemon.
> >> > clock_systohc="YES"
> >> >
> >> > # If you want to set the system time to the current hardware clock
> >> > # during bootup, then say "YES" here. You do not need this if you are
> >> > # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> >> > # Also, be aware that if you set this to "NO", the system time will
> >> > # never be saved to the hardware clock unless you set
> >> > # clock_systohc="YES" above.
> >> > clock_hctosys="NO"
> >> >
> >> > # If you wish to pass any other arguments to hwclock during bootup,
> >> > # you may do so here. Alpha users may wish to use --arc or --srm here.
> >> > clock_args=""
> >> >
> >> > In the kernel config file I had set:
> >> >
> >> > CONFIG_RTC_HCTOSYS=y
> >> > CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> >> >
> >> > I would exspect that after a reboot of the system which system time is
> >> > correctly set via ntp-client that the hwclock and system time only
> >> > differ in a small amount of time.
> >> >
> >> > But:
> >> > solfire:/home/mccramer>hwclock
> >> > Mon Feb 6 19:05:11 2012 -0.172569 seconds
> >> > solfire:/home/mccramer>date
> >> > Mon Feb 6 18:49:37 CET 2012
> >> > solfire:/home/mccramer>
> >>
> >> I don't know the CET tz, but I can see that the minutes don't match
> >> up. I assume you rand the two commands within seconds of each other.
> >> Is this true immediately after bootup, or does it take a while to get
> >> that far off? It could be that your hardware clock is drifting, and
> >> the system won't reset it until it goes to shutdown.
> >>
> >> --
> >> :wq
> >>
> >
> > Hi Michael,
> > thank you for your reply.
> > I set the configuration as mentioned above and booted twice with about
> > five minutes wait.
> > The commands were executed within seconds, yes.
> > All hardware clocks drifts, but this is not the problem.
> > The problem is that the hardware clock is not set to the system time
> > in contradiction to what I think the comments in the config are
> > saying.
> >
> > How can I fix that?
>
> I don't really know. Are you sure that rtc0 corresponds to your
> hardware clock device? Does setting "clock_hctosys" to YES have any
> effect?
>
> Is this in some kind of virtual-machine or hypervised environment
> where something may be blocking the OS from setting the hardware
> clock?
>
> --
> :wq
>
It is set
lrwxrwxrwx 1 root root 4 2012-02-07 00:52 /dev/rtc -> rtc0
crwxrwx--- 1 root audio 254, 0 2012-02-07 00:52 /dev/rtc0
and it is the only device of its kind.
As I wrote I am using ntp_client for setting my system time while
booting up.
So reagrdless wheter I am setting clock_hctosys I am alway getting
the correct system time later in the bootprocess via ntp.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 18:52 ` Florian Philipp
@ 2012-02-07 0:00 ` meino.cramer
2012-02-07 0:23 ` Dale
2012-02-07 16:56 ` Andrea Conti
0 siblings, 2 replies; 15+ messages in thread
From: meino.cramer @ 2012-02-07 0:00 UTC (permalink / raw
To: gentoo-user
Florian Philipp <lists@binarywings.net> [12-02-06 20:00]:
> Am 06.02.2012 19:39, schrieb meino.cramer@gmx.de:
> > Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
> >> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
> >>> Hi,
> >>>
> >>> to get the correct system time I use ntp-client in the boot process.
> >>> Furthermore in /etc/conf.d/hwclock I set:
> >>>
> >>> # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
> >>> # Greenwich Mean Time). If that clock is set to the local time, then
> >>> # set CLOCK to "local". Note that if you dual boot with Windows, then
> >>> # you should set it to "local".
> >>> clock="UTC"
> >>>
> >>> # If you want to set the Hardware Clock to the current System Time
> >>> # (software clock) during shutdown, then say "YES" here.
> >>> # You normally don't need to do this if you run a ntp daemon.
> >>> clock_systohc="YES"
> >>>
> >>> # If you want to set the system time to the current hardware clock
> >>> # during bootup, then say "YES" here. You do not need this if you are
> >>> # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> >>> # Also, be aware that if you set this to "NO", the system time will
> >>> # never be saved to the hardware clock unless you set
> >>> # clock_systohc="YES" above.
> >>> clock_hctosys="NO"
> >>>
> >>> # If you wish to pass any other arguments to hwclock during bootup,
> >>> # you may do so here. Alpha users may wish to use --arc or --srm here.
> >>> clock_args=""
> >>>
> >>> In the kernel config file I had set:
> >>>
> >>> CONFIG_RTC_HCTOSYS=y
> >>> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> >>>
> >>> I would exspect that after a reboot of the system which system time is
> >>> correctly set via ntp-client that the hwclock and system time only
> >>> differ in a small amount of time.
> >>>
> >>> But:
> >>> solfire:/home/mccramer>hwclock
> >>> Mon Feb 6 19:05:11 2012 -0.172569 seconds
> >>> solfire:/home/mccramer>date
> >>> Mon Feb 6 18:49:37 CET 2012
> >>> solfire:/home/mccramer>
> >>
> >> I don't know the CET tz, but I can see that the minutes don't match
> >> up. I assume you rand the two commands within seconds of each other.
> >> Is this true immediately after bootup, or does it take a while to get
> >> that far off? It could be that your hardware clock is drifting, and
> >> the system won't reset it until it goes to shutdown.
> >>
> >> --
> >> :wq
> >>
> >
> > Hi Michael,
> > thank you for your reply.
> > I set the configuration as mentioned above and booted twice with about
> > five minutes wait.
> > The commands were executed within seconds, yes.
> > All hardware clocks drifts, but this is not the problem.
> > The problem is that the hardware clock is not set to the system time
> > in contradiction to what I think the comments in the config are
> > saying.
> >
> > How can I fix that?
> >
> > Thank you very much in advance for any help!
> > Best regards,
> > mcc
> >
> >
> >
>
> Is your RTC driver compiled into the kernel? The "httosys" function of
> the kernel takes place before any modules can be loaded and will fail if
> your CMOS clock driver is a module.
>
> Activating clock_hctosys in /etc/conf.d/hwclock should solve this as it
> takes place later in the boot process.
>
> Regards,
> Florian Philipp
>
As I wrote the kernel is configured
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
so there is no module, the functionality is compiled into the kernel.
And as I wrote I am using the ntp_client to set the system time via
ntp/ntp_client later in the boot process to get the correct system
time.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-07 0:00 ` meino.cramer
@ 2012-02-07 0:23 ` Dale
2012-02-07 1:25 ` Peter Humphrey
2012-02-07 16:56 ` Andrea Conti
1 sibling, 1 reply; 15+ messages in thread
From: Dale @ 2012-02-07 0:23 UTC (permalink / raw
To: gentoo-user
meino.cramer@gmx.de wrote:
>
> As I wrote the kernel is configured
>
>
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
>
> so there is no module, the functionality is compiled into the kernel.
>
> And as I wrote I am using the ntp_client to set the system time via
> ntp/ntp_client later in the boot process to get the correct system
> time.
>
When I built my new rig, I had to use chrony to set my clock for a good
long while. For some reason, ntp just plain failed. After ntp had
several updates and bug fixes, I tried it again and it now works fine.
Could be that maybe something is buggy and affects your system, similar
to the way it did on mine, and you need to either back up a few
versions, run unstable if you are not already or as I did, try chrony
for a while until ntp gets fixed.
I never did figure out why ntp failed on me. I do know my clock was
awful without something keeping it on track.
If you choose to use chrony, I'd be glad to share my config and help you
set it up. I think I still got the commands to finds the closest time
server and stuff. It about runs with default settings tho.
Dale
:-) :-)
P. S. Here is the info:
chrony.conf
! Use the exclamation mark to comment lines and not the # key.
server 64.6.144.6
server 67.159.5.90
server 67.59.168.233
server 204.62.14.98
driftfile /etc/chrony.drift
logdir /var/log/chrony
log measurements statistics tracking rtc
You may not want the last line. It logs a LOT. I used it for testing.
Note: Use ! to comment instead of #. Weird. Command to find closest
servers:
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
# netselect -s 3 0.gentoo.pool.ntp.org
Just pick the ones with the least delay.
Now I'm gone.
--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!
Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-06 23:57 ` meino.cramer
@ 2012-02-07 1:02 ` Michael Mol
0 siblings, 0 replies; 15+ messages in thread
From: Michael Mol @ 2012-02-07 1:02 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 4572 bytes --]
On Feb 6, 2012 7:00 PM, <meino.cramer@gmx.de> wrote:
>
> Michael Mol <mikemol@gmail.com> [12-02-06 19:56]:
> > On Mon, Feb 6, 2012 at 1:39 PM, <meino.cramer@gmx.de> wrote:
> > > Michael Mol <mikemol@gmail.com> [12-02-06 19:20]:
> > >> On Mon, Feb 6, 2012 at 12:51 PM, <meino.cramer@gmx.de> wrote:
> > >> > Hi,
> > >> >
> > >> > to get the correct system time I use ntp-client in the boot
process.
> > >> > Furthermore in /etc/conf.d/hwclock I set:
> > >> >
> > >> > # Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also
known as
> > >> > # Greenwich Mean Time). If that clock is set to the local
time, then
> > >> > # set CLOCK to "local". Note that if you dual boot with
Windows, then
> > >> > # you should set it to "local".
> > >> > clock="UTC"
> > >> >
> > >> > # If you want to set the Hardware Clock to the current System
Time
> > >> > # (software clock) during shutdown, then say "YES" here.
> > >> > # You normally don't need to do this if you run a ntp daemon.
> > >> > clock_systohc="YES"
> > >> >
> > >> > # If you want to set the system time to the current hardware
clock
> > >> > # during bootup, then say "YES" here. You do not need this if
you are
> > >> > # running a modern kernel with CONFIG_RTC_HCTOSYS set to y.
> > >> > # Also, be aware that if you set this to "NO", the system time
will
> > >> > # never be saved to the hardware clock unless you set
> > >> > # clock_systohc="YES" above.
> > >> > clock_hctosys="NO"
> > >> >
> > >> > # If you wish to pass any other arguments to hwclock during
bootup,
> > >> > # you may do so here. Alpha users may wish to use --arc or
--srm here.
> > >> > clock_args=""
> > >> >
> > >> > In the kernel config file I had set:
> > >> >
> > >> > CONFIG_RTC_HCTOSYS=y
> > >> > CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
> > >> >
> > >> > I would exspect that after a reboot of the system which system
time is
> > >> > correctly set via ntp-client that the hwclock and system time only
> > >> > differ in a small amount of time.
> > >> >
> > >> > But:
> > >> > solfire:/home/mccramer>hwclock
> > >> > Mon Feb 6 19:05:11 2012 -0.172569 seconds
> > >> > solfire:/home/mccramer>date
> > >> > Mon Feb 6 18:49:37 CET 2012
> > >> > solfire:/home/mccramer>
> > >>
> > >> I don't know the CET tz, but I can see that the minutes don't match
> > >> up. I assume you rand the two commands within seconds of each other.
> > >> Is this true immediately after bootup, or does it take a while to get
> > >> that far off? It could be that your hardware clock is drifting, and
> > >> the system won't reset it until it goes to shutdown.
> > >>
> > >> --
> > >> :wq
> > >>
> > >
> > > Hi Michael,
> > > thank you for your reply.
> > > I set the configuration as mentioned above and booted twice with about
> > > five minutes wait.
> > > The commands were executed within seconds, yes.
> > > All hardware clocks drifts, but this is not the problem.
> > > The problem is that the hardware clock is not set to the system time
> > > in contradiction to what I think the comments in the config are
> > > saying.
> > >
> > > How can I fix that?
> >
> > I don't really know. Are you sure that rtc0 corresponds to your
> > hardware clock device? Does setting "clock_hctosys" to YES have any
> > effect?
> >
> > Is this in some kind of virtual-machine or hypervised environment
> > where something may be blocking the OS from setting the hardware
> > clock?
> >
> > --
> > :wq
> >
>
> It is set
>
> lrwxrwxrwx 1 root root 4 2012-02-07 00:52 /dev/rtc -> rtc0
> crwxrwx--- 1 root audio 254, 0 2012-02-07 00:52 /dev/rtc0
>
> and it is the only device of its kind.
>
> As I wrote I am using ntp_client for setting my system time while
> booting up.
> So reagrdless wheter I am setting clock_hctosys I am alway getting
> the correct system time later in the bootprocess via ntp.
Sure. My question was more geared toward specifically obtaining information
about your hardware clock, which you probed with the hwclock command. You
insist your hardware clock isn't being updated, but I have insufficient
data to verify that, or even get a feel for the behavior of your system.
*Obviously* all hardware clocks drift, but I was wondering if your hardware
clock was drifting notably rapidly. I don't know at what interval the
hardware clock would normally be updated by the kernel, or what constitutes
'continuous' in that context.
Timestamps along with the commands and for notable events, such as when
ntpclient ran during bootup and when the system shut down, would be useful.
[-- Attachment #2: Type: text/html, Size: 6547 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-07 0:23 ` Dale
@ 2012-02-07 1:25 ` Peter Humphrey
2012-02-07 3:02 ` Dale
0 siblings, 1 reply; 15+ messages in thread
From: Peter Humphrey @ 2012-02-07 1:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 351 bytes --]
On Tuesday 07 February 2012 00:23:43 Dale wrote:
> Note: Use ! to comment instead of #. Weird. Command to find closest
> servers:
You don't have to. Chrony's convention is to use # for its own comments and
! for assignments you want to comment out. Just a convention though. Use
either at will.
--
Rgds
Peter Linux Counter 5290, 1994-04-23
[-- Attachment #2: Type: text/html, Size: 2286 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-07 1:25 ` Peter Humphrey
@ 2012-02-07 3:02 ` Dale
0 siblings, 0 replies; 15+ messages in thread
From: Dale @ 2012-02-07 3:02 UTC (permalink / raw
To: gentoo-user
Peter Humphrey wrote:
> On Tuesday 07 February 2012 00:23:43 Dale wrote:
>
>
>
>> Note: Use ! to comment instead of #. Weird. Command to find closest
>
>> servers:
>
>
>
> You don't have to. Chrony's convention is to use # for its own comments
> and ! for assignments you want to comment out. Just a convention though.
> Use either at will.
>
>
>
> --
>
> Rgds
>
> Peter Linux Counter 5290, 1994-04-23
>
>
>
Good to know. To the best of my knowledge, this is the only program I
have ever ran into that said to use ! instead of # for comments.
Dale
:-) :-)
--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!
Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] hwclock <--> sysclock and the ntp-client
2012-02-07 0:00 ` meino.cramer
2012-02-07 0:23 ` Dale
@ 2012-02-07 16:56 ` Andrea Conti
1 sibling, 0 replies; 15+ messages in thread
From: Andrea Conti @ 2012-02-07 16:56 UTC (permalink / raw
To: gentoo-user
>> Is your RTC driver compiled into the kernel?
> CONFIG_RTC_HCTOSYS=y
> CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
Those have nothing to do with the RTC *driver*.
AFAIK on a PC the relevant option is
CONFIG_RTC_DRV_CMOS
andrea
^ permalink raw reply [flat|nested] 15+ messages in thread
* [gentoo-user] Re: hwclock <--> sysclock and the ntp-client
2012-02-06 17:51 [gentoo-user] hwclock <--> sysclock and the ntp-client meino.cramer
2012-02-06 18:11 ` Michael Mol
2012-02-06 18:46 ` Dale
@ 2012-02-08 14:45 ` James
2 siblings, 0 replies; 15+ messages in thread
From: James @ 2012-02-08 14:45 UTC (permalink / raw
To: gentoo-user
<meino.cramer <at> gmx.de> writes:
> PS: I need a correct hwclock since I want to wake the system via the
> hwclock.
Hello Meino,
date, reads the "software clock"
hwclock -r reads the "hardware clock"
hwclock -r ; date
so I use this to manually check if they
are syncd. If not use this to set the hwclock
hwclock --systohc if the hw clock is correct
otherwise
hwclcok --set (to use the date as the setting for
the hwclock.
Note: on different hardware from different vendors,
occasionally you run into a hardware clock that
does not cooperate. Somethings booking from window
to set the hwclock will work. Other times you are
SHOOL (shi out of luck).
Now look at man hwclock and use those optinos to correct
what your issue is. As other have pointed out NTP
has it's own nuances that must additionally be considered.
As well as any kernel issues, which I did not address.
Good Hunting!
hth,
James
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-02-08 14:47 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 17:51 [gentoo-user] hwclock <--> sysclock and the ntp-client meino.cramer
2012-02-06 18:11 ` Michael Mol
2012-02-06 18:39 ` meino.cramer
2012-02-06 18:48 ` Michael Mol
2012-02-06 23:57 ` meino.cramer
2012-02-07 1:02 ` Michael Mol
2012-02-06 18:52 ` Florian Philipp
2012-02-07 0:00 ` meino.cramer
2012-02-07 0:23 ` Dale
2012-02-07 1:25 ` Peter Humphrey
2012-02-07 3:02 ` Dale
2012-02-07 16:56 ` Andrea Conti
2012-02-06 18:46 ` Dale
2012-02-06 18:50 ` Michael Mol
2012-02-08 14:45 ` [gentoo-user] " James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox