Bug 1476219
Summary: | Handle white spaces before variables in '/etc/kdump.conf' - add appropriate error handling and documentation | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Kenneth D'souza <kdsouza> | ||||
Component: | kexec-tools | Assignee: | Bhupesh Sharma <bhsharma> | ||||
Status: | CLOSED ERRATA | QA Contact: | Ziqian SUN (Zamir) <zsun> | ||||
Severity: | low | Docs Contact: | Adam Kvitek <akvitek> | ||||
Priority: | low | ||||||
Version: | 7.3 | CC: | bhsharma, kdsouza, kdump-team-bugs, qzhao, ruyang | ||||
Target Milestone: | rc | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | kexec-tools-2.0.15-8.el7 | Doc Type: | Bug Fix | ||||
Doc Text: |
Users now receive message with prompt to remove white space characters in the `/etc/kdump.conf`
Previously, one or more leading white space characters before a *kdump* configuration item in the `/etc/kdump.conf` caused incorrect *kdump* configuration. With this update, an error message with prompt to remove the leading white space characters return to users, and *kdump* no longer fails due to the described behavior.
|
Story Points: | --- | ||||
Clone Of: | |||||||
: | 1484945 (view as bug list) | Environment: | |||||
Last Closed: | 2018-04-10 14:10:42 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: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1420851, 1469549, 1473055 | ||||||
Attachments: |
|
Description
Kenneth D'souza
2017-07-28 10:29:38 UTC
Created attachment 1305890 [details]
kdumpctl file with spacefunction to detect white space.
sorry for the typo: 3.Crash the kernel and check that the dump is stored in /var/crash and not /tmp/crash. This is reproducible with RHEL 7.4 kexec-tools: # rpm -qa kexec-tools kexec-tools-2.0.0-307.el6.x86_64 Initially it took me some time to reproduce this and I had to confirm this with the reporter as when I used a location inside '/tmp' the issue was NOT reproducible: path /tmp/crash <--- space before path however, when I used a crash location outside /tmp, I was able to reproduce this issue, for e.g. on beaker machine ibm-x3650m4-01-vm-06.lab.eng.bos.redhat.com with path variable set as: path /home/bhsharma <--- space before path Will add appropriate handling after observing the default behaviour on other utilities like dracut. To make clear about the problem, I have some questions about the bug: 1. where is the space? for example "path /tmp/crash", do you mean " patch /tmp/crash" or "path /tmp/crash"? 2. where is the RHEL6 code to strip the space? I do not find it. OTOH, in rhel6 code we have below code: local _save_path=$(grep "^path" /etc/kdump.conf|awk '{print $2}') So it is assumed that path should not prefixed with extra spaces. Thanks Dave > 1. where is the space? for example "path /tmp/crash", do you mean " patch
s/patch/path
(In reply to Dave Young from comment #7) > > 1. where is the space? for example "path /tmp/crash", do you mean " patch > s/patch/path As I captured in Comment 5, the issue is seen when we have space before path. 1> space is before the path: Example: <whitespace> path /home/crash 2> RHEL 6 code to deal with white spaces: [root@localhost Desktop]# uname -r 2.6.32-696.el6.x86_64 [root@localhost Desktop]# rpm -qa | grep kexec kexec-tools-2.0.0-307.el6.x86_64 [root@localhost Desktop]# The code is in /sbin/mkdumprd Code Snippet ============================================================================ # deal with indentation space_at_front=`echo "$msg" | grep -o "^[[:space:]]\+"` msg=`echo "$msg" | sed 's/^\s\+//'` msg_printed=0 while [ $# -gt 0 ]; do trace_level=`echo "$1" | grep -o '^[0-9]\+'` trace_in_higher_levels=`echo "$1" | grep -o '+'` trace=`echo $1 | sed "s/^.*://"` if [ -z "$trace_level" ]; then trace_level=0 fi insert_trace=0 if [ -n "$trace_in_higher_levels" ]; then if [ "$log_level" -ge "$trace_level" ]; then insert_trace=1 fi else if [ "$log_level" -eq "$trace_level" ]; then insert_trace=1 fi fi if [ $insert_trace -eq 1 ]; then if [ $msg_printed -eq 0 ]; then emit "${space_at_front}echo \"$prefix $msg\"" msg_printed=1 fi emit "${space_at_front}$func $trace" fi shift done } =========================================================================== Thanks Kenneth D'souza (In reply to Kenneth D'souza from comment #9) > > 1> space is before the path: > > Example: > > <whitespace> path /home/crash > > 2> RHEL 6 code to deal with white spaces: > > [root@localhost Desktop]# uname -r > 2.6.32-696.el6.x86_64 > [root@localhost Desktop]# rpm -qa | grep kexec > kexec-tools-2.0.0-307.el6.x86_64 > [root@localhost Desktop]# > > The code is in /sbin/mkdumprd > > Code Snippet > > ============================================================================ > # deal with indentation > space_at_front=`echo "$msg" | grep -o "^[[:space:]]\+"` > msg=`echo "$msg" | sed 's/^\s\+//'` > > msg_printed=0 > while [ $# -gt 0 ]; do > trace_level=`echo "$1" | grep -o '^[0-9]\+'` > trace_in_higher_levels=`echo "$1" | grep -o '+'` > trace=`echo $1 | sed "s/^.*://"` > > if [ -z "$trace_level" ]; then > trace_level=0 > fi > > insert_trace=0 > if [ -n "$trace_in_higher_levels" ]; then > if [ "$log_level" -ge "$trace_level" ]; then > insert_trace=1 > fi > else > if [ "$log_level" -eq "$trace_level" ]; then > insert_trace=1 > fi > fi > > if [ $insert_trace -eq 1 ]; then > if [ $msg_printed -eq 0 ]; then > emit "${space_at_front}echo \"$prefix $msg\"" > msg_printed=1 > fi > emit "${space_at_front}$func $trace" > fi > shift > done > } > Thanks for the quick reply. But above code is not for kdump.conf handling, it is for memory trace related. If so it is clear that it happens to work in RHEL6, but actually we do not support it, as I mentioned in last comment 6, RHEL6 also need "path" without extra spaces from the code. Thus we'd better to enforce any options in kdump.conf should not start with spaces and close this bug. Reopening this issue. As discussed with Dave Young on irc, we need to add proper error handling in kdumpctl and also document this properly, as any user can add a space before a variable in kdump.conf and this should be handled properly. This makes us go with the option b> There should be no space before the path by failing the service. 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://access.redhat.com/errata/RHBA-2018:0807 |