[sos-devel] [sosreport] Wrong exit code on fail

Denis Egorenko egorenko.den at gmail.com
Wed Dec 11 09:15:55 UTC 2019


Hello team,

I'm trying to use sosreport 3.8 (https://github.com/sosreport/sos/tree/3.8)
and faced with an issue related to wrong command exit code, when no free
space in temp dir:


:~# sosreport -o haproxy

sosreport (version 3.8)

This command will collect system configuration and diagnostic
information from this Ubuntu system. An archive containing the collected
information will be generated in /tmp/sos.neaj075h.

For more information on Ubuntu visit:

  http://www.ubuntu.com/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.


 Setting up archive ...

 No space left on device while setting up archive

:~# echo $?
0


There is no free space indeed:

:~# df -h /tmp
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/vg0-tmp  481M  477M     0 100% /tmp


Here is config file:

:~# cat /etc/sos.conf
[general]
#verbose = 3
#verify = yes
batch = yes
all-logs = yes
#log-size = 15

[plugins]
#disable = rpm, selinux, dovecot

[tunables]
#rpm.rpmva = off


If i'll try to run with '-q' option it will just use automatically
*/var/tmp* dir, but i need to get error code even with default parameters.

Any ideas how to force sosreport fail in such situations? Thanks in advance.

Denis.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/sos-devel/attachments/20191211/92ad86cd/attachment.htm>


More information about the sos-devel mailing list