| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Complete the removal of the diagnose functionality by removing the
methods in the Plugin class and sosreport module, command line
options and documentation.
|
|
|
|
|
| |
The yum module's analyze method is pretty useless. It just checks
for extra /etc/yum.repos.d files on RHEL systems. Delete it.
|
|
|
|
|
|
|
|
|
| |
The analyze methods are no longer used and the kernel module's
regex-table based taint checking is kinda klunky and a maintenance
problem.
Delete this code but collect the initstate, refcnt and taint files
from /sys/modules/*.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The analyze machinery hasn't been hooked up since commit 6ea48cb.
The use of these methods has also not been especially clear: some
modules trigger additional file/command collection here while
others only add alerts (the original purpose of analyze()). Other
module call the addAlert() interface from their setup() method.
Move the SELinux module's analyze functionality into the main
setup() method but make it conditional on setroubleshoot being
installed as it's necessary for the current implementation.
|
|
|
|
|
|
| |
Delete the diagnose() methods from all modules still using it.
The diagnostics feature never worked well and is better implemented
to run after-the-fact on the data collected in the tarball.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Storing a (correct) SELinux context for files in procfs and sysfs
leads to tonnes of ugly spew when the tarball is unpacked as these
contexts are not permitted on "normal" file systems:
tar: sosreport-rhel7-vm1-20121210145629/proc/sys/vm: Cannot setfilecon: Permission denied
tar: sosreport-rhel7-vm1-20121210145629/proc/sys/vm/percpu_pagelist_fraction: Cannot setfilecon: Permission denied
tar: sosreport-rhel7-vm1-20121210145629/proc/sys/vm: Cannot setfilecon: Permission denied
tar: sosreport-rhel7-vm1-20121210145629/proc/sys/vm/scan_unevictable_pages: Cannot setfilecon: Permission denied
Etc.
Check for these path prefixes in TarFileArchive.add_file() and skip
generating a pax header for them.
This isn't a perfect fix; it may be better to move this up to a
higer layer (i.e. within the Plugin class's file handling routines)
and also to filter by context rather than path (since SELinux
contexts are a property of an inode not a path and a user could
mount these file systems at other locations).
This partially fixes Issue #79 but I'll keep it open for the time
being to track these improvements.
|
|
|
|
|
| |
Forgot to refresh the copy of the module in HEAD; pickup two
additional fixes added in testing.
|
|
|
|
|
|
|
|
|
| |
Add a new module to collect systemd information. This is the start
of a general re-organisation of the init related information
captured by sos.
Initially collect systemctl and journalctl command output as well
as (some) configuration files owned by the package.
|
|
|
|
|
|
|
| |
The sysctl configuration and state belongs to the kernel. Reflect
this by moving the collection of sysctl.conf to the kernel module
(where sysctl -a is already captured) and add collection of the
/etc/sysctl.d and /lib/sysctl.d directories.
|
| |
|
| |
|
|
|
|
|
| |
Make the sar module more tolerant of broken environments and users
force-enabling the module when its own enabled check fails.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the TarArchive class preserve permissions and SELinux context on
all files and directories it collects. This requires us to recursively
add the parent directories of any files copied in by full path (or the
directory would only be implicitly created and so receive default
ownership and permissions and no SELinux context).
To make this work, don't call tarfile.add() to recursively add
directories - the doCopyFileOrDir machinery in the Plugin class already
handles directory recursion properly. Instead when a directory is passed
to add_file(), just create a TarInfo record of type tarfile.DIRTYPE and
propagate the permissions from the host file system.
The SELinux contexts have the unfortunate side-effect of spewing errors
if unpacked without --no-selinux as some contexts cannot be placed on
some file systems.
It may be more useful to eventually store the contexts in the
in a file rather than directly in the tarball.
Before:
drwxr-xr-x. 9 root root 640 Dec 7 00:57 proc
lrwxrwxrwx. 1 root root 30 Dec 7 00:57 ps -> sos_commands/process/ps_auxwww
drwxr-xr-x. 2 root root 60 Dec 7 00:57 root
drwxr-xr-x. 2 root root 80 Dec 7 00:57 sbin
After:
dr-xr-xr-x. 9 root root 640 Dec 5 19:07 proc
lrwxrwxrwx. 1 root root 30 Dec 7 00:58 ps -> sos_commands/process/ps_auxwww
dr-xr-x---. 2 root root 60 Dec 7 00:48 root
dr-xr-xr-x. 2 root root 80 Dec 7 00:57 sbin
More fixes issue #76
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The sar module assumes that /var/log/sa exists when it is enabled.
Check for its presence and exit from setup early.
|
|
|
|
|
|
|
|
|
|
| |
Files that are stored as strings bypass the permissions code added
in commit 74c1476 since they are added to the archive via
add_string().
Add a check to see if a destination exists in the host file system.
If it does propagate the permissions to the stored string's tar
record.
|
|
|
|
|
|
|
| |
Stat files during archiving and propagate the mode, atime, uid and
gid to the archive.
Fixes issue #76
|
|
|
|
|
|
|
|
|
|
|
| |
Currently a non-readable file causes an exception and resulting
error logging as the path is passed blindly to archive.add_file().
There are legitimate reasons why directories colleceted by sos may
contain files not readable by root, e.g. in sysfs where there are
numerous write-only trigger files.
Check the permissions via os.stat() before reading the file and
substitute unreadable files with the empty string.
|
|
|
|
|
|
|
|
|
| |
The Debian iSCSI class implements iscsi target data collection.
Move it to the iscsitarget module where it belongs.
This needs further work to add an iSCSI initiator implementation
for Debian and Ubuntu. That should be very straightforward but
needs a system for testing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we pass a 'None' into shutil.rmtree() it will os.path.join() that
with a string leading to a TypeError:
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 961, in main
sos.execute()
TypeError: coercing to Unicode: need string or buffer, NoneType found
> /usr/lib64/python2.7/posixpath.py(133)islink()
-> st = os.lstat(path)
Rather than catch the exception test tmp_dir before calling rmtree.
|
|
|
|
|
|
|
| |
Fix a typo that prevents any package manager queries from
succeeding and change the wrapper function to explicitly test
the results list rather than relying on an exception to detect
an empty result set.
|
|
|
|
|
| |
Now that collectOutputNow is fixed restore the exception handling
block and logging in copy_stuff().
|
|
|
|
|
| |
Do not assume that tmp_dir has been set and wrap tree deletion in
a try block.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Update the RHN module to match current RHEL6 where relevant and
add collection of spacewalk-debug on appropriate systems.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setting the default console loglevel to FATAL causes important log
messages to be discarded leading to mysterious failures for e.g.
when an unknown option is specified:
[root@hex tmp]# sosreport --batch --debug -k psacct.all=True
sosreport (version 2.3)
[root@hex tmp]#
Lolwhut?
[root@hex tmp]# sosreport -vvvv --batch --debug -k psacct.all=True
sosreport (version 2.3)
no such option "all" for plugin (psacct)
[root@hex tmp]#
|
| |
|
| |
|
|
|
|
|
|
| |
Test for the existence of the hardware.py script in the
RedHatHardware module instead of relying on an exception
from the output gathering functions.
|
|
|
|
|
|
| |
When a command is not found log and exit from the function early.
For all other statuses try to collect output anyway in case anything
useful was written to stdout or stderr.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Rename doRegexSub and doRegexExtOutputSub to doFileSub and
doExtOutputSub respectively.
|
|
|
|
|
|
| |
Add a doRegexExtOutputSub() function to mirror doRegExSub(). This
allows modukes ti apply an arbitrary regular expression
substitution to the output collected from external commands.
|
|
|
|
| |
Update cluster module to match current rhel-6
|
| |
|
| |
|
|
|
|
|
| |
Remove duplicate gluster module accidentally committed while
forward porting the current rhel-6 version.
|
| |
|
| |
|
| |
|