Bug 580014 - sosreport does not work if hostname is without a dot
sosreport does not work if hostname is without a dot
Product: Fedora
Classification: Fedora
Component: sos (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Adam Stokes
Fedora Extras Quality Assurance
Depends On:
Blocks: 580015
  Show dependency treegraph
Reported: 2010-04-07 05:53 EDT by Michal Schmidt
Modified: 2010-07-20 21:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 580015 (view as bug list)
Last Closed: 2010-07-20 21:40:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
always trim the newline character from hostname (602 bytes, patch)
2010-04-07 05:53 EDT, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Michal Schmidt 2010-04-07 05:53:29 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:
$ /bin/hostname

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
]: MSchmidt
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):

How reproducible:

Steps to Reproduce:
1. Configure HOSTNAME=somename in /etc/sysconfig/network
2. Run sosreport
Actual results:
sosreport does not generate a useful archive.

Expected results:
sosreport should generate a several MB long report file.

Additional info:
Patch attached.

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