Opened 15 years ago

Closed 15 years ago

#2497 closed defect (fixed)

setclock boot script does not start in stable LFS 6.5

Reported by: ruslan Owned by: lfs-book@…
Priority: normal Milestone: 6.6
Component: Bootscripts Version: 6.5
Severity: normal Keywords: bootscripts setclock
Cc:

Description

Hi, I have noticed that setclock script does not start during boot up in LFS 6.5 (lfs-bootscripts-20090812)

If check bootscripts Makefile, no startup or kill links are created in rcsysinit.d or rc0.d rc6.d

Change History (5)

comment:1 by Bryan Kadzban, 15 years ago

Milestone: 6.6

That's because it runs from a udev rule now; see 55-lfs.rules:

# This causes the system clock to be set as soon as /dev/rtc becomes available.
SUBSYSTEM=="rtc", MODE="0644", ACTION=="add", RUN+="/etc/rc.d/init.d/setclock start"

Leaving this open, however, as there has been some discussion lately that seems to point to a need to duplicate that rule for KERNEL=="rtc" (old non-rtc-class kernels) as well as SUBSYSTEM=="rtc". (We should probably also reorder the keys, to put the MODE assignment after the ACTION match.)

If hwclock is getting run, this isn't a bug. If it doesn't run, then I would suspect you can get it to run by changing SUBSYSTEM to KERNEL in that rule (or by adding a duplicate).

As far as kill links go: We removed those a couple releases ago. See the BLFS book's section on ntpd if you want them. (We figure in the absence of an external time source, there's no particular reason to believe that the system clock is any more accurate than the hardware clock. Non-timer hardware interrupts, along with the fact that the kernel is not real-time, make it jitter, or drift completely.)

comment:2 by Bryan Kadzban, 15 years ago

Assuming hwclock was *not* run before, does upgrading to udev-config-20090925 fix that? (Once it becomes available on the downloads page.)

comment:3 by ruslan, 15 years ago

Hi,

I did some investigation and have found that problems occured partly due to my fault. Sorry :(

First, I did not expect setclock running from udev rule, so never check that. I noticed that my localtime is wrong, check lfs-bootscripts and did not find any startup links under rcsysinit.d and nothing in bootscrips changelog about setclock removal. So I decided that this is a bug.

Actual reason of problem was wrong kernel config settings under RTC. /dev/rtc was not created and setclock did not start. Now it works well with both versions of rules: with the one from the book and with 20090925.

I am still wondering why it was necessary to move setclock startup from rcsysinit.d to udev rules. Is it so important "clock to be set as soon as /dev/rtc becomes available"?

Keeping all startups in one place under rc.d looks more consistent for me. And hwclock works even if RTC is disabled in kernel at all. It seems startup from rcsysinit.d is safer, because there is no such dependency on kernel config.

in reply to:  3 comment:4 by DJ Lucas, 15 years ago

Replying to ruslan.st:

I am still wondering why it was necessary to move setclock startup from rcsysinit.d to udev rules. Is it so important "clock to be set as soon as /dev/rtc becomes available"?

This becomes important when boot logging is enabled.

Keeping all startups in one place under rc.d looks more consistent for me. And hwclock works even if RTC is disabled in kernel at all.

This is only true for x86 with the current version of hwclock. The original code that current hwclock was forked from, does support setting the hardware clock without a device node on other arches.

http://giraffe-data.com/software/about_hwclock.html

comment:5 by bdubbs@…, 15 years ago

Resolution: fixed
Status: newclosed

Marking as fixed by udev-config-20090925.

Note: See TracTickets for help on using tickets.