Bug 1132300
| Summary: | /sbin/mkdumprd: line 3923: [: : integer expression expected | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Sumit Rai <sumitrai96> | ||||
| Component: | kexec-tools | Assignee: | Minfei Huang <mhuang> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Qiao Zhao <qzhao> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.5 | CC: | bhe, jeharris, kdump-team-bugs, qzhao, ruyang, vgoyal | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | kexec-tools-2.0.0-281.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-07-22 06:01:12 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
It's been a couple of days and I haven't received any comments. Could you please let me know what I did wrong so that I can fix it. - Thanks I think this is a simple fix and it is reasonable to fix it. Bao can you please have a look at this one. Created attachment 961954 [details]
screenshot with error message
Seen also on a first-time boot of 3.10.33-rt32 (self-built). Attaching screenshot. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1271.html |
Description of problem: I know you folks don't support custom kernels, and this corner case will probably won't present itself in enterprise environment, however since the bug is in user space script, and custom compiled kernel only created a condition that's not handled properly by mkdumprd script I feel obligated to report this issue and let you folks decide. Given that "/proc/sys/crypto/fips_enabled" is not present (Some crypto library is probably not enabled). Issue 1: When you start the kdump service when no kdump initial ramdisk is present, it tries to rebuild the ramdisk and calls script mkdumprd at some point. [root@localhost ~]# service kdump start No kdump initial ramdisk found. [WARNING] Rebuilding /boot/initrd-2.6.34-rckdump.img cat: /proc/sys/crypto/fips_enabled: No such file or directory /sbin/mkdumprd: line 3923: [: : integer expression expected Starting kdump: [ OK ] [root@localhost ~]# echo $? 0 In the absence of fips_enabled file, variable FIPS_MODE is not set. While the comparison [ "$FIPS_MODE" -eq 1 ] && setup_fips on line 3923 would have worked fine for string comparison regardless of whether variable is set/unset, it doesn't for integer comparison when variable is not set. Script moves ahead regardless, and creates initial ramdisk. I copied the script, and wrote wrote two patches that takes care of "/sbin/mkdumprd: line 3923: [: : integer expression expected" warning, but as far as "cat: /proc/sys/crypto/fips_enabled: No such file or directory" message is concerned, I don't know how you folks want to handle that. Patch 1: --- /sbin/mkdumprd 2014-08-21 10:37:30.848654720 +0530 +++ /root/mkdumprd 2014-08-21 10:33:07.819945059 +0530 @@ -3920,7 +3920,7 @@ done | sort | uniq | sed '/^ *$/d'` rm -f $TEMPLDCFG - [ "$FIPS_MODE" -eq 1 ] && setup_fips + [ "0$FIPS_MODE" -eq 1 ] && setup_fips // it's numeric zero not the alphabet O #copy the binaries and their shared libraries to the archive for n in $bin $kdump_libs $k_extras $fips_hmac; do Patch 2: --- /sbin/mkdumprd 2014-08-21 10:43:31.793620929 +0530 +++ /root/mkdumprd 2014-08-21 10:43:25.312605379 +0530 @@ -93,7 +93,7 @@ DISK_TIMEOUT=180 DEBUG_MEM_LEVEL="0" -FIPS_MODE=$(cat /proc/sys/crypto/fips_enabled) +FIPS_MODE=$(cat /proc/sys/crypto/fips_enabled || echo -n 0) error() { Issue 2: Run /sbin/mkinitrd --help cat: /proc/sys/crypto/fips_enabled: No such file or directory usage: mkdumprd [--version] [--help] [-v] [-d] [-f] [--preload <module>] [--image-version] [--builtin=<module>] [--omit-dmraid] [--fstab=<fstab>] [--nocompress] <initrd-image> <kernel-version> (ex: mkdumprd /boot/initrd-2.2.5-15.img 2.2.5-15) It should not be checking for fips_enabled file in first place if invoked with --help option. Version-Release number of selected component (if applicable): kexec-tools-2.0.0-273.el6.x86_64 How reproducible: Since you can't delete "fips_enabled" file from proc, and compiling you own kernel without fips may be too much work, you can easily reproduce the bug if you 1. Change the path "/proc/sys/crypto/fips_enabled" in line 96 of file /sbin/mkdumprd to a non-existent file. 96: FIPS_MODE=$(cat /proc/sys/crypto/fips_enabled) 2. For Issue 1, Make sure no kdump initial ramdisk are present in /boot folder and start the kdump service by "service kdump start". For issue 2, just type /sbin/mkdumprd --help. Actual results: Excerpt from 'service kdump start' output: 1. cat: /proc/sys/crypto/fips_enabled: No such file or directory 2. /sbin/mkdumprd: line 3923: [: : integer expression expected Expected results: In line 1, I think it's a good idea to let user know that fips will not be setup instead of this message. Line 2 is clearly not expected. In /sbin/mkdumprd output posted above, message "cat: /proc/sys/crypto/fips_enabled: No such file or directory" must not appear. Let me know if you need any more information.