Bug 461551

Summary: initscripts unmounts /usr before calling kexec which needs it...
Product: Red Hat Enterprise Linux 5 Reporter: Jonathan Peatfield <j.s.peatfield>
Component: kexec-toolsAssignee: Neil Horman <nhorman>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 5.2CC: notting, qcai, riek
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 600608 (view as bug list) Environment:
Last Closed: 2009-01-20 20:59:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to statically link zlib
none
fix to patch to specfile
none
different patch to specfile
none
make that a unidiff (doh!) none

Description Jonathan Peatfield 2008-09-09 01:15:10 UTC
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 14:29:02 UTC
The tools need to be able to work with just /. Assigning to kexec-tools.

Comment 2 Neil Horman 2008-09-09 15:24:41 UTC
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 15:48:12 UTC
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 16:10:32 UTC
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 16:12:04 UTC
Created attachment 316204 [details]
fix to patch to specfile

Trivial change...

Comment 6 Jonathan Peatfield 2008-09-09 17:16:11 UTC
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 17:19:37 UTC
Created attachment 316215 [details]
different patch to specfile

edit Makefile.conf after running comnfigure...

Comment 8 Jonathan Peatfield 2008-09-09 17:21:00 UTC
Created attachment 316216 [details]
make that a unidiff (doh!)

Comment 9 Jonathan Peatfield 2008-09-09 17:24:24 UTC
Comment on attachment 316215 [details]
different patch to specfile

wrong diff options

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