Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 89554 - clock skew because /etc/init.d/clock interferes with /etc/init.d/chrony
Summary: clock skew because /etc/init.d/clock interferes with /etc/init.d/chrony
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-18 10:35 UTC by Joerg Schaible
Modified: 2005-04-19 18:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Schaible 2005-04-18 10:35:23 UTC
I use chrony as my clock management app and my kernel has rtc support. According to chrony's FAQ (http://chrony.sunsite.dk/faq.php) I should avoid to use hwclock if chrony is managing the time with the rtc. Gentoo's default configuration in /etc/conf.d/chrony enables automatically rtc support if it is available from the kernel.

This creates major headaches for time adjustment, since at boot time the /etc/init.d/clock will *always* adjust the time also. You cannot even remove clock from the boot sequence, since quite a lot start-up scripts have a "need clock" line. Therefore I've added a "provide clockfix" line in clock and chrony and changed any other start-up script from "need clock" to "need clockfix". While this actually prevents hwclock from running automatically (no /etc/adjtime is generated anymore), the depscan.sh still tries to add clock automatically to the boot level each time it is run (at start-up as well as after an emerge) resulting in the follwoing warning:

 ====== %< =======
 >>> Regenerating /etc/ld.so.cache...
  * Caching service dependencies...
 head: `-1' option is obsolete; use `-n 1' since this will be removed in the future
 tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
 head: `-2' option is obsolete; use `-n 2' since this will be removed in the future
 tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
  *  Service 'chronyd' already provide 'clockfix'!;
  *  Not adding service 'clock'...
 ====== %< =======

- J
Comment 1 Joerg Schaible 2005-04-18 10:35:23 UTC
I use chrony as my clock management app and my kernel has rtc support. According to chrony's FAQ (http://chrony.sunsite.dk/faq.php) I should avoid to use hwclock if chrony is managing the time with the rtc. Gentoo's default configuration in /etc/conf.d/chrony enables automatically rtc support if it is available from the kernel.

This creates major headaches for time adjustment, since at boot time the /etc/init.d/clock will *always* adjust the time also. You cannot even remove clock from the boot sequence, since quite a lot start-up scripts have a "need clock" line. Therefore I've added a "provide clockfix" line in clock and chrony and changed any other start-up script from "need clock" to "need clockfix". While this actually prevents hwclock from running automatically (no /etc/adjtime is generated anymore), the depscan.sh still tries to add clock automatically to the boot level each time it is run (at start-up as well as after an emerge) resulting in the follwoing warning:

 ====== %< =======
 >>> Regenerating /etc/ld.so.cache...
  * Caching service dependencies...
 head: `-1' option is obsolete; use `-n 1' since this will be removed in the future
 tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
 head: `-2' option is obsolete; use `-n 2' since this will be removed in the future
 tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
  *  Service 'chronyd' already provide 'clockfix'!;
  *  Not adding service 'clock'...
 ====== %< =======

- Jörg

Reproducible: Always
Steps to Reproduce:
1. emerge chrony
2. rc-update -a chronyd boot
3. rm /etc/adjtime
4. reboot
5. ls -dl /etc/a*

Actual Results:  
rtc is managed by hwclock as well as by chronyd resulting in a disastrous clock  
skews each time.  

Expected Results:  
only the app managing rtc that I determined.
Comment 2 Robert Paskowitz (RETIRED) gentoo-dev 2005-04-18 15:33:03 UTC
Have you tried having 'chrony' provide 'clock', removing 'clock' from boot run level, and adding 'chrony' to boot runlevel?

Multiple scripts can provide the same thing, this is what happens for the need/provide net.
Comment 3 Joerg Schaible 2005-04-18 20:43:50 UTC
This does not work, since you cannot provide something, that is named exactly like a script. You'll get an error calculating the deps.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2005-04-19 01:39:49 UTC
Why don
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-04-19 01:39:49 UTC
Why don´t you set CLOCK_OPTS="--noadjfile" in /etc/conf.d/clock ?
Comment 6 Joerg Schaible 2005-04-19 14:03:15 UTC
Well, I don't have a /etc/conf.d/clock and it is also not references in /etc/init.d/clock.

Hint:

bash-2.05b$ etcat -v baselayout
[ Results for search key           : baselayout ]
[ Candidate applications found : 10 ]

 Only printing found installed programs.

*  sys-apps/baselayout :
        [  I] 1.9.4-r6 (0)
        [M  ] 1.9.4-r7 (0)
        [M~ ] 1.11.9-r1 (0)
        [M~ ] 1.11.10-r3 (0)
        [M~ ] 1.11.10-r4 (0)
        [M~ ] 1.11.10-r5 (0)
        [M~ ] 1.11.10-r6 (0)
        [M~ ] 1.11.10-r7 (0)
        [M~ ] 1.12.0_alpha1-r4 (0)
        [M~ ] 1.12.0_alpha2 (0)
Comment 7 SpanKY gentoo-dev 2005-04-19 18:55:50 UTC
newer baselayouts have a /etc/conf.d/clock

as for the depend on 'clock' issue, i only see two packages which have 'need clock' and those are dcron/metalog which i'll change to 'use clock'