Red Hat Bugzilla – Bug 580014
sosreport does not work if hostname is without a dot
Last modified: 2010-07-20 21:40:38 EDT
Created attachment 404880 [details]
always trim the newline character from hostname
Description of problem:
On my system /bin/hostname returns a name without a domain name:
This confuses sosreport, because it expects to find a dot (".") in the returned hostname. The 'hostName' function then returns the name including the newline character, which has funny results:
Press ENTER to continue, or CTRL-C to quit.
Please enter your first initial and last name [leela
Please enter the case number that you are generating this report for: 123
Running plugins. Please wait ...
Creating compressed archive...
/bin/tar: leela: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
/bin/sh: line 1: -2010040711481270633713: command not found
sh: line 1: -2010040711481270633713: command not found
Your sosreport has been generated and saved in:
The md5sum is: 8dc5aea5b03dff8595f096f9e368e888
Please send this file to your support representative.
The resulting file is only 32 bytes long and is thus useless.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Configure HOSTNAME=somename in /etc/sysconfig/network
2. Run sosreport
sosreport does not generate a useful archive.
sosreport should generate a several MB long report file.