Menu

#3 /dev/rtc: Device or resource busy

closed-rejected
None
5
2004-05-06
2004-04-14
No

When I run nvram-wakeup, it exits with the following
error message:

/dev/rtc: Device or resource busy

This is due to the fact that /dev/rtc is in use by chrony,
an NTP daemon.

Because /dev/rtc is used only for determining if the RTC
stores the UTC, my suggestion is to add a command line
switch that disable this control and lets the user specify
whether the RTC is UTC.

For example:

-u [utc|local|auto]

when -u is not given, auto is assumed
when -u is given with no option, utc is assumed
when -u is not set to auto, access to /dev/rtc is disabled

Discussion

  • Sergei Haller

    Sergei Haller - 2004-04-14
    • assigned_to: nobody --> bistr-o-math
    • status: open --> open-rejected
     
  • Sergei Haller

    Sergei Haller - 2004-04-14

    Logged In: YES
    user_id=76018

    Please correct me if I'm wrong, but as far as I know, no
    program should hold the RTC device opened continuously.

    BTW, why should an NTP daemon use the RTC device?

    Even if it wants to do it for some reason, it should open
    /dev/rtc, read it and then close it.

    So I'd suppose to fix chrony.

     
  • Lorenzo Cappelletti

    Logged In: YES
    user_id=279407

    From chrony's help <http://chrony.sunsite.dk/guide/chrony.
    html>, section 3.4.1 "Assumptions/how the software works":

    Whilst the computer is running, chronyd makes measurements
    of the real-time clock (RTC) (via the /dev/rtc interface, which
    must be compiled into the kernel). An estimate is made of the
    RTC error at a particular RTC second, and the rate at which
    the RTC gains or loses time relative to true time.

    Anyway, what if nvram-wakeup access /dev/rtc while the
    resource is busy, even for a few milliseconds?

     
  • Nobody/Anonymous

    Logged In: NO

    BTW, the RTC device driver takes care of that no process
    accesses
    the actual rtc registers at the same time, so there is
    really no need in blocking.

     
  • Sergei Haller

    Sergei Haller - 2004-04-15

    Logged In: YES
    user_id=76018

    argh. for some reason I was logged out and SF. discarded one
    Comment and posted the second as nobody, anyway, here we go:

    > Whilst the computer is running, chronyd makes
    > measurements of the real-time clock (RTC)

    well, then chrony is more than just an NTP client.

    but no program should block the RTC device at all.
    look at the sources of chrony (tc_linux.c,v 1.32, line 615):

    fd = open (CNF_GetRtcDevice(), O_RDWR);

    there is no need in O_RDWR, O_RDONLY is sufficient!

    BTW: nvram-wakeup also uses the RTC device to read/set the
    RTC alarm if the option rtc_time=ON is set.

     
  • Sergei Haller

    Sergei Haller - 2004-05-06

    Logged In: YES
    user_id=76018

    closing this after three weeks.

    the topic can be reopened if needed.

     
  • Sergei Haller

    Sergei Haller - 2004-05-06
    • status: open-rejected --> closed-rejected
     

Log in to post a comment.