This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 461551 - initscripts unmounts /usr before calling kexec which needs it...
initscripts unmounts /usr before calling kexec which needs it...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kexec-tools (Show other bugs)
5.2
All Linux
medium Severity low
: rc
: ---
Assigned To: Neil Horman
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-08 21:15 EDT by Jonathan Peatfield
Modified: 2009-01-20 15:59 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 600608 (view as bug list)
Environment:
Last Closed: 2009-01-20 15:59:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to statically link zlib (1.46 KB, patch)
2008-09-09 11:24 EDT, Neil Horman
no flags Details | Diff
fix to patch to specfile (1.46 KB, patch)
2008-09-09 12:12 EDT, Jonathan Peatfield
no flags Details | Diff
different patch to specfile (1006 bytes, patch)
2008-09-09 13:19 EDT, Jonathan Peatfield
no flags Details | Diff
make that a unidiff (doh!) (1.48 KB, patch)
2008-09-09 13:21 EDT, Jonathan Peatfield
no flags Details | Diff

  None (edit)
Description Jonathan Peatfield 2008-09-08 21:15:10 EDT
Description of problem:

If using kexec to do a fast reboot on a system where /usr is a different fs than / then the initscripts halt/reboot code will have unmounmted /usr before it attempts to call $kexec_command -e -x

Version-Release number of selected component (if applicable):

 initscripts-8.45.19.EL-1 and earlier

How reproducible:

 100%

Steps to Reproduce:
1. install machine with seperate / and /usr

2. /sbin/kexec -l /boot/vmlinuz-2.6.18-92.1.10.el5 --append="ro root=/dev/ZexSys00/root" --initrd=/boot/initrd-2.6.18-92.1.10.el5.img

(or whatever the lines are from your grub config)

3. /sbin/reboot
  
Actual results:

it goes throuh the full reboot via the bios despite the kexec code being in the script.

Expected results:

faster reboot via kexec and no bios

Additional info:

$ ldd /sbin/kexec 
        linux-gate.so.1 =>  (0x00aac000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00fce000)
        libc.so.6 => /lib/libc.so.6 (0x006c3000)
        /lib/ld-linux.so.2 (0x0038b000)

so perhaps either the script should avoid unmounting /usr or have a copy of libz.so.1 in /

Of course it probably only needs libz to load in the kernel/initrd so a stub libz might in fact be enough to allow the call to kexec -e -x to work or maybe it can onlyo load libz if it actually needs functions from it.

I've added some debugging to /etc/rc.d/init.d/halt to show that /usr is unmounted before kexec is called but then you can probably see that easily enough without my pathetic hacks.

Or I suppose you could just add some docs saying that /, /usr must be on the same fs for reboot to call kexec.
Comment 1 Bill Nottingham 2008-09-09 10:29:02 EDT
The tools need to be able to work with just /. Assigning to kexec-tools.
Comment 2 Neil Horman 2008-09-09 11:24:41 EDT
Created attachment 316198 [details]
patch to statically link zlib

here, please confirm that this fixes the problem for you.  Thanks
Comment 3 Jonathan Peatfield 2008-09-09 11:48:12 EDT
I take it that this specfile patch is against kexec-tools-1.102pre-21.el5

I'll try rebuilding with that patch applied and see what happens...
Comment 4 Jonathan Peatfield 2008-09-09 12:10:32 EDT
With a minor tweak to move the --without-zlib outside the %ifarch that seems to work for me...
Comment 5 Jonathan Peatfield 2008-09-09 12:12:04 EDT
Created attachment 316204 [details]
fix to patch to specfile

Trivial change...
Comment 6 Jonathan Peatfield 2008-09-09 13:16:11 EDT
Hmm, configure using --without-zlib results in a very different content of Makefile.conf which seems to be missing all the HAVE_<feature> options in DEFS.  I don't know if it really matters - the resulting kexec binary seems to work for me but I may be lucky or it might be a problem on certain platforms.

Also since HAVE_ZLIB_H is missing it doesn't link against zlib at all since the function in kexec/kexec.c is #ifdef'd out so slurp_decompress_file() doesn't do any decompression.  I don't know if that really matters or not.

Here is a terrible hack to leave the configure alone and directly patch the Makefile.conf to add the static-link option...  You can probably make this a lot cleaner...
Comment 7 Jonathan Peatfield 2008-09-09 13:19:37 EDT
Created attachment 316215 [details]
different patch to specfile

edit Makefile.conf after running comnfigure...
Comment 8 Jonathan Peatfield 2008-09-09 13:21:00 EDT
Created attachment 316216 [details]
make that a unidiff (doh!)
Comment 9 Jonathan Peatfield 2008-09-09 13:24:24 EDT
Comment on attachment 316215 [details]
different patch to specfile

wrong diff options
Comment 13 errata-xmlrpc 2009-01-20 15:59:54 EST
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-2009-0105.html

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