Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 598978

Summary: RFE: provide a way to specify destination filename
Product: Red Hat Enterprise Linux 6 Reporter: Denys Vlasenko <dvlasenk>
Component: sosAssignee: Adam Stokes <astokes>
Status: CLOSED CURRENTRELEASE QA Contact: David Kutálek <dkutalek>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: agk, ahecox, bmr, borgan, dkutalek, gavin, npajkovs, snagar, syeghiay
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-2.2-0.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 829069 (view as bug list) Environment:
Last Closed: 2010-11-10 21:38:23 UTC Type: ---
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: 589147, 829069    

Description Denys Vlasenko 2010-06-02 13:27:16 UTC
bug 589147 is caused by sosreport trying to save the file in /tmp, which is prohibited by selinux.

abrt later copies the file to a abrt crash dump directory.

Please provide a sosreport command line option to specify the destination file. If this causes problems with picking the right compression method, for example:

sosreport ... -o /path/to/file.tar.gz
sosreport ... -o /path/to/file.tar.bz2

- you might find it non-trivial to teach sosreport to figure out how to conform to tarfile extension - then I'd settle for an option which merely specifies a destination directory or destination basename (without .gz etc)

Comment 2 Adam Stokes 2010-06-02 14:23:08 UTC
You can set a temporary directory to store the captures files and also the compressed archive (--tmp-dir)

This should be available in latest sos release in RHEL6 beta.

Could you please confirm if this solves the issue?

Comment 3 Nikola Pajkovsky 2010-06-02 15:37:17 UTC
I've tried on rhel6 machine with this result. What's wrong?

[root@redhat ~]# mkdir sos
[root@redhat ~]# sosreport --tmp-dir sos/

sosreport (version 2.1)

This utility will collect some detailed  information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is  packaged under
/tmp, which you can send to a support representative.
Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
and it will be considered confidential information.

This process may take a while to complete.
No changes will be made to your system.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [redhat]: 
Please enter the case number that you are generating this report for: 

  Running plugins. Please wait ...

  Completed [52/52] ...      
Creating compressed archive...
/bin/sh: sos/sosreport-redhat-20100602173547.tar.xz: No such file or directory
/bin/tar: -: Cannot write: Broken pipe
/bin/tar: Error is not recoverable: exiting now
Traceback (most recent call last):
  File "/usr/sbin/sosreport", line 23, in <module>
    sosreport(sys.argv[1:])
  File "/usr/lib/python2.6/site-packages/sos/sosreport.py", line 835, in sosreport
    GlobalVars.policy.displayResults()
  File "/usr/lib/python2.6/site-packages/sos/policyredhat.py", line 313, in displayResults
    fp = open(self.report_file, "r")
IOError: [Errno 2] No such file or directory: 'sos/sosreport-redhat-20100602173547.tar.xz'
[root@redhat ~]# ls -l sos/
total 0

Comment 4 Adam Stokes 2010-06-02 16:21:43 UTC
Does `pwd`/sos/ exist?

Thanks,
Adam

Comment 5 Denys Vlasenko 2010-06-02 16:58:01 UTC
Of course. "mkdir sos" created it, and "ls -l sos/" did not says that it doesn't exist.

Comment 6 Adam Stokes 2010-06-02 17:13:50 UTC
Thanks for the quick replies -- I'm able to reproduce so I'll see what I can do.

Thanks,
Adam

Comment 7 Adam Stokes 2010-06-03 18:17:47 UTC
I belive I've fixed this issue it should make its way into nightly as soon as I can get the cluster plugin wrapped up.

Thanks
Adam

Comment 8 Denys Vlasenko 2010-06-08 12:00:20 UTC
Where we can get this build for testing?

Comment 9 Adam Stokes 2010-06-08 15:09:20 UTC
Hi Denys,

I have a scratch build up at 

https://brewweb.devel.redhat.com/taskinfo?taskID=2502268

Thanks,
Adam

Comment 10 Denys Vlasenko 2010-06-10 12:31:43 UTC
I tested it and it works for me, please push it to RHEL6 ASAP...

Comment 11 RHEL Program Management 2010-06-10 14:08:27 UTC
This feature request did not get resolved in time for Feature Freeze
for the current Red Hat Enterprise Linux release and has now been
denied. It has been proposed for the next Red Hat Enterprise Linux
release. If you would still like it considered for the current
release as an exception, please make that request with your support
representative.

Comment 16 releng-rhel@redhat.com 2010-11-10 21:38:23 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.