Bug 1468730

Summary: --all-logs option does not limit sizes, despite man page and usage message
Product: Red Hat Enterprise Linux 6 Reporter: Mason Loring Bliss <mbliss>
Component: sosAssignee: Shane Bradley <sbradley>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: agk, bmr, cww, gavin, plambri, pmoravec
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-16 17:06:44 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:

Description Mason Loring Bliss 2017-07-07 18:46:47 UTC
Description of problem:

When running sosreport with --all-logs, the description is that file size limits
are not maintained, and that sosreports can get very large as a result. However,
a reading of the code and experimental runs show this to not be the case.

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

sos-3.2-15.el7.noarch

How reproducible:

Make a large logfile, and generate an sosreport that should include it. The
data is not included.

Steps to Reproduce:

[root@rhel6 tmp]# dd if=/dev/urandom of=/var/log/messages-big bs=1M count=20
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 1.68827 s, 12.4 MB/s
[root@rhel6 tmp]# sosreport
...
[root@rhel6 tmp]# tar xf sosreport-rhel6.int.blisses.org-20170707123828.tar.xz
[root@rhel6 tmp]# cd sosreport-rhel6.int.blisses.org-20170707123828
[root@rhel6 sosreport-rhel6.int.blisses.org-20170707123828]# cd var/log/
[root@rhel6 log]# ls -lh messages*
-rw-------. 1 root root 165K Jul  7 12:35 messages
-rw-------. 1 root root 350K Jun 19 12:01 messages-20170619
-rw-------. 1 root root  98K Jun 25 03:12 messages-20170625
lrwxrwxrwx. 1 root root   50 Jul  7 12:38 messages-big ->
../../sos_strings/logs/var.log.messages-big.tailed
[root@rhel6 log]# ls -l ../../sos_strings/logs/var.log.messages-big.tailed
-rw-r--r--. 1 root root 0 Jul  7 12:38
../../sos_strings/logs/var.log.messages-big.tailed
[root@rhel6 log]# ls -l /var/log/messages-big
-rw-r--r--. 1 root root 20971520 Jul  7 12:38 /var/log/messages-big

Actual results:

".tailed" file generated, sans data.

Expected results:

Because of --all-logs, expected to see whole file, despite size.

Additional info:

Comment 2 Bryn M. Reeves 2017-07-07 19:32:42 UTC
It's just a documentation bug - see my reply in bug 1468728. You need to give --log-size=0 if you want to also disable log size limits.

Comment 3 Mason Loring Bliss 2017-07-07 19:36:51 UTC
As I understand it, the majority of our customers roll out RHEL 6 still as their
primary platform, and this is a fairly important tool for supporting them.

This is one of three bugs, and I'm hoping they're all corrected, so it might be
reasonable to correct this in a set of commits that includes the other fixes,
especially given that this is arguably related to 1468730, where such a commit
might have more impedance by itself.

The other bugs:

    1468730
    1468736

Comment 4 Mason Loring Bliss 2017-07-07 19:38:04 UTC
Ah, sorry, was confusing my bugs. I thought you were replying to the doc bug.

Comment 5 Mason Loring Bliss 2017-07-07 19:39:14 UTC
Re: comment 2, if this behaviour isn't to be changed, it's all the more important
that the docs be corrected then. Either way is fine with me, but this is a fairly
important tool that gets used a bunch.

Comment 6 Bryn M. Reeves 2017-07-07 19:44:06 UTC
> the description is that file size limits are not maintained

I can see how you could read that into it, but it's not actually what the man page says - it just says that reports may grow very large if this is used (they may).

We'll change the wording but again it's much easier to make minor changes like this upstream and in RHEL7.