Red Hat Bugzilla – Bug 348651
[RFE] add init u support for initlevel 0 and 6
Last modified: 2014-03-16 23:11:13 EDT
Description of problem:
init u is ignored for initlevel 0 and 6. Is there a reason for this ? We'd
need to be able to rexec init in initlevel 0 and 6.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. during a shutdown process try to rexec init
init u is ignored
init process is restarted.
We need to restart init in a chroot environment (something similar to the
initrd but for halting) during the reboot/halt operation. This is needed to
free the root filesystem from all processes and to be able umount it cleanly.
IMHO, the affected part of init.c would just be:
1838 if (strchr("S12345",runlevel) == NULL)
What in init is holding it open that it needs re-execed?
That's a good question. I think its just because init was started in the
rootfs. A fuser -mv / shows that init somehow "uses" the rootfs:
# fuser -mv / 2>&1 | grep " init"
/: root 1 .rce. init
Right, but we get that for normal setups as well and we don't need to re-exec it.
Yes, I think your right for "normal" setups. There, the /etc/init.d/halt
script is is remounting the rootfs ro before the real reboot or halt command
is executed and therefore everything is clean.
I'm sorry, I should have given you some more background information about what
we are doing. We are using GFS to build up a diskless sharedroot cluster with
RHEL. Have a look at http://www.open-sharedroot.org for more information.
In this kind of setup, we'd like to pivot_root to an initrd like chroot
environment during reboot/halt and umount the GFS rootfs there before
executing the real reboot or halt command. To be able to do this, no process
is allowed to run on the rootfs at this time. The idea is to re-exec init into
the chroot environment during a halt or reboot operation and then umount the
Does the obvious patch for that line work for you?
yes, I tested it by commenting out both lines. Adding a 6 and 0 would also be
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
Building as 2.86-15.el5.
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.