RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 598850 - halt fails due to hwclock failure
Summary: halt fails due to hwclock failure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 636861
TreeView+ depends on / blocked
 
Reported: 2010-06-02 08:03 UTC by Andrew Jones
Modified: 2011-05-19 13:51 UTC (History)
4 users (show)

Fixed In Version: initscripts-9.03.18-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 636861 (view as bug list)
Environment:
Last Closed: 2011-05-19 13:51:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0647 0 normal SHIPPED_LIVE initscripts bug fix and enhancement update 2011-05-19 09:37:27 UTC

Description Andrew Jones 2010-06-02 08:03:42 UTC
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 Program Management 2010-06-02 08:06:11 UTC
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 15:20:26 UTC
Wouldn't this be needed for PV DomU on earlier releases too?

Comment 3 Andrew Jones 2010-06-02 16:21:33 UTC
(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 19:26:24 UTC
I'm curious, yes. (I also am curious what happens on RHEL 5.)

Comment 5 Andrew Jones 2010-06-08 13:16:56 UTC
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 17:25:44 UTC
...
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 Program Management 2010-07-15 14:48:00 UTC
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 14:00:37 UTC
(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 13:51:09 UTC
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.