Bug 598850 - halt fails due to hwclock failure
halt fails due to hwclock failure
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: initscripts Maintenance Team
qe-baseos-daemons
:
Depends On:
Blocks: 636861
  Show dependency treegraph
 
Reported: 2010-06-02 04:03 EDT by Andrew Jones
Modified: 2011-05-19 09:51 EDT (History)
4 users (show)

See Also:
Fixed In Version: initscripts-9.03.18-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 636861 (view as bug list)
Environment:
Last Closed: 2011-05-19 09:51:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Andrew Jones 2010-06-02 04:03:42 EDT
When halting the latest rhel6 running as a xen guest, these messages are printed

Syncing hardware clock to system time Cannot access the Hardware Clock via any known method.
            Use the --debug option to see the details of our search for an access method.
         [FAILED]


When adding the --debug 

hwclock from util-linux-ng 2.17.2
hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.

/dev/rtc won't exist when rhel6 is running as a PV XenDomU, and possibly also won't exist when running as a KVM guest, but I didn't check that. The easiest solution is

# diff /etc/rc.d/init.d/halt.orig /etc/rc.d/init.d/halt

107c107

< [ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock --systohc

---

> [ -x /sbin/hwclock -a -e /dev/rtc ] && action $"Syncing hardware clock to system time" /sbin/hwclock --systohc
Comment 1 RHEL Product and Program Management 2010-06-02 04:06:11 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 2 Bill Nottingham 2010-06-02 11:20:26 EDT
Wouldn't this be needed for PV DomU on earlier releases too?
Comment 3 Andrew Jones 2010-06-02 12:21:33 EDT
(In reply to comment #2)
> Wouldn't this be needed for PV DomU on earlier releases too?    

I haven't seen this until now. Possibly I overlooked it, but I think I would have, so I'm guessing something changed that has caused it to be more verbose or present or ...

I could try an Alpha 3 or Beta 1 or whatever, if it's necessary.
Comment 4 Bill Nottingham 2010-06-02 15:26:24 EDT
I'm curious, yes. (I also am curious what happens on RHEL 5.)
Comment 5 Andrew Jones 2010-06-08 09:16:56 EDT
RHEL 5.5 I get this log to the console

audit(1276001260.860:13): audit_pid=0 old=1354 by auid=4294967295

type=1111 audit(1276001270.013:14): user pid=2676 uid=0 auid=4294967295 msg='changing system time: exe="/sbin/hwclock" (hostname=?, addr=?, terminal=console res=failed)'


RHEL 6 Beta 4, I get the following

Sending all processes the TERM signal... [  OK  ]
Sending all processes the KILL signal... init: rc main process (1133) stopped by STOP signal
init: rc main process (1133) continued by CONT signal
[  OK  ]



So in all cases there's something funny going on, but the latest RHEL6 makes it the most obvious.
Comment 6 Bill Nottingham 2010-06-08 13:25:44 EDT
...
Sending all processes the KILL signal... init: rc main process (1133) stopped
by STOP signal
init: rc main process (1133) continued by CONT signal
...

This has nothing to do with hwclock. So, I'll try and test some more, but I think the issue is that (for whatever reason) the RHEL 5 kernel creates a /dev/rtc device, and the RHEL 6 kernel doesn't.
Comment 7 RHEL Product and Program Management 2010-07-15 10:48:00 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 10 Andrew Jones 2010-09-23 10:00:37 EDT
(In reply to comment #8)
> As the underlying problem really is why we don't get a /dev/rtc under a guest
> RHEL6 with xen i'm moving this to kernel.
> 
> Thanks & regards, Phil

No, the driver can't work on virt guests (there's no RTC), so it doesn't make sense to have a /dev/rtc node. There actually shouldn't be a /dev/rtc node on RHEL5 either because the driver also fails to load there, as can be seen in this dmesg log

rtc: IRQ 8 is not free.

That proves we bail out of rtc_init() on RHEL5 as well. However, the /dev/rtc node is in RHEL5 virt guests because it's listed in makedev.d. As I pointed out in comment 5, the presence of that node also causes errors with hwclock on shutdown. So it would be best if it wasn't there, or we also need to include a test that /dev/rtc works before trying to use it in the initscripts.

I'm kicking this bug back to initscripts to handle the case that /dev/rtc is not there for RHEL6. Then I'll clone this bug to RHEL5 to handle the case that /dev/rtc is there, but doesn't work. Both these cases RHEL6 and RHEL5 are possible when running as a guest.
Comment 15 errata-xmlrpc 2011-05-19 09:51:09 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0647.html

Note You need to log in before you can comment on or make changes to this bug.