Bug 794981 - kdump init script creates useless directory and empty vmcore file
kdump init script creates useless directory and empty vmcore file
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kexec-tools (Show other bugs)
6.2
Unspecified Linux
unspecified Severity medium
: rc
: ---
Assigned To: Cong Wang
Zhiyou Liu
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-18 09:05 EST by Takahisa Tanaka
Modified: 2013-09-29 22:30 EDT (History)
4 users (show)

See Also:
Fixed In Version: kexec-tools-2.0.0-227.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 08:06:54 EDT
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 against kexec-tools-2.0.0-209.el6 (1.44 KB, patch)
2012-02-18 09:10 EST, Takahisa Tanaka
no flags Details | Diff
Modified patch against kexec-tools-2.0.0-209.el6 (1.47 KB, patch)
2012-02-18 10:32 EST, Takahisa Tanaka
no flags Details | Diff
A better patch (1.30 KB, patch)
2012-02-21 07:57 EST, Cong Wang
no flags Details | Diff
Detail of test log (3.99 KB, text/plain)
2012-02-22 08:20 EST, Takahisa Tanaka
no flags Details

  None (edit)
Description Takahisa Tanaka 2012-02-18 09:05:18 EST
Description of problem:
In the case of raw partition is dump target and raw partition doesn't have correct diskdump header, when kdump init script is started, kdump init script creates useless directory and empty vmcore file in /var/crash. 

I attached /etc/init.d/kdump patch. This patch checks diskdump header in raw partition. If diskdump header is invalid, kdump init script doesn't create directory and vmcore file in /var/crash. In addition this patch checks exit value of makedumpfile command. If makedumpfile command fail, kdump init script log and display warning message.

 # rpm -q kexec-tools
 kexec-tools-2.0.0-209.el6.x86_64
 # grep -v "^#" /etc/kdump.conf
 raw /dev/cciss/c0d0p3
 path /var/crash
 core_collector makedumpfile -c --message-level 1 -d 31
 default shell
 #
 # ls -lR /var/crash
 /var/crash:
 total 0     <----------- /var/crash directory is empty
 # service kdump restart
 Stopping kdump:                                [  OK  ]
 Starting kdump:                                [  OK  ]
 #
 # ls -lR /var/crash
 /var/crash:
 total 4
 drwxr-xr-x. 2 root root 4096 Feb 16 13:43 2012-02-16-13:43
 
 /var/crash/2012-02-16-13:43:
 total 0
 -rw-------. 1 root root 0 Feb 16 13:43 vmcore
 #
 
 ... Wait for more than one minutes ...
 
 # service kdump restart
 Stopping kdump:                                [  OK  ]
 Starting kdump:                                [  OK  ]
 # ls -lR /var/crash
 /var/crash:
 total 8
 drwxr-xr-x. 2 root root 4096 Feb 16 13:43 2012-02-16-13:43
 drwxr-xr-x. 2 root root 4096 Feb 16 13:45 2012-02-16-13:45
 
 /var/crash/2012-02-16-13:43:
 total 0
 -rw-------. 1 root root 0 Feb 16 13:43 vmcore
 
 /var/crash/2012-02-16-13:45:
 total 0
 -rw-------. 1 root root 0 Feb 16 13:45 vmcore
 #


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


How reproducible:
always

Steps to Reproduce:
1. Setup raw partition dump target
2. Start kdump service 
3. 
  
Actual results:
When raw partition doesn't have dump data, kdump init script creates useless directory and empty vmcore file.

Expected results:
directory and vmcore file should create only when correct dump data exists in raw partition. 

Additional info:
Comment 1 Takahisa Tanaka 2012-02-18 09:10:18 EST
Created attachment 564052 [details]
Patch against kexec-tools-2.0.0-209.el6
Comment 3 Takahisa Tanaka 2012-02-18 10:32:22 EST
Created attachment 564058 [details]
Modified patch against kexec-tools-2.0.0-209.el6

Sorry, The variable name  DISK_DUMP_SINATURE was inappropriate. I reattach the patch which modified the variable name to MAKEDUMPFILE_SIGNATURE from DISK_DUMP_SINATURE.
Comment 4 Cong Wang 2012-02-21 07:57:25 EST
Created attachment 564664 [details]
A better patch

This patch is a little better than yours, could you help to test this one please?

Thanks!
Comment 5 Takahisa Tanaka 2012-02-21 11:13:13 EST
Sure! I'm going to test your patch.
When a test finished, I'm going to report a test result.


Regards,
Takahisa
Comment 6 Takahisa Tanaka 2012-02-22 08:19:58 EST
Amerigo

I finished the following tests. All tests are success.
Please refer to the attached file for detail of test log. 

Test item
 1. When kdump service is started, kdump init script doesn't create 
    vmcore and directroy.
 2. When panic occurred, kdump init script creates vmcore and directory.
 3. kdump init script doesn't create vmcore and directroy, 
    if raw partition doesn't have a correct dump data.
 4. kdump service is stopped, if the dump device isn't a raw partition.
 5. kdump service is stopped, if the mkdir command fails.
 6. vmcore is created in specified directory, if the path directive is 
    specified in kdump.conf.
 7. vmcore is created in /var/crash, if the path directive is not specified 
    in kdump.conf.


Thank you for your quick response.
Takahisa
Comment 7 Takahisa Tanaka 2012-02-22 08:20:31 EST
Created attachment 564959 [details]
Detail of test log
Comment 8 Cong Wang 2012-02-23 07:38:53 EST
Excellent! Thanks a lot, Takahisa!
Comment 11 errata-xmlrpc 2012-06-20 08:06:54 EDT
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.

http://rhn.redhat.com/errata/RHBA-2012-0758.html

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