[sos-devel] v2: plugins/selinux fixfiles options doesn't work as intended

John Haxby john.haxby at oracle.com
Mon Jan 19 17:08:41 UTC 2015


Hello All,

To recap, the fixfiles option for the selinux plugin sends numerous
messages (mostly warnings) to the screen and logs just this to the sosreport:

   Checking / /boot /dev /dev/hugepages /dev/mqueue /dev/pts /dev/shm /home /run /sys /sys/fs/cgroup

This is a little less than useful :)

The first patch here is in response to
https://github.com/sosreport/sos/issues/267 and simply provides a mechanism
for discarding stderr when running a command.  A Plugin.add_cmd_output() has
a new keep_stderr keyword argument whose default value is "True".

The second patch changes the fixfiles option for the selinux plugin to use
"restorecon -Rvn /" instead of "fixfiles check -v" because the output of the
latteer cannot be redirected (the bug for this was recently closed WONTFIX
which is perhaps surprising).  Having got output that can be redirected, the
restorecon stderr is no long kept.

I went with "keep_stderr=True" rather than "discard_stderr=False" because I
don't like double negatives.  Originally, as well, I actually had stderr sent
directly to /dev/null, but I decided to go with the simpler option of
capturing it and throwing it away.

I've at least created a sosreport and including the fixfiles option and
everything looks OK but I'm willing to believe (more than willing) tbat I've
overlooked something.

jch




More information about the sos-devel mailing list