From 2518e3348c05bb6f432cb802d0bc1ddddfd0e02e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 30 2020 19:26:21 +0000 Subject: import sos-3.9.1-5.el8 --- diff --git a/SOURCES/sos-bz1776549-podman-buildah-rootless.patch b/SOURCES/sos-bz1776549-podman-buildah-rootless.patch index 8158b2b..a61c152 100644 --- a/SOURCES/sos-bz1776549-podman-buildah-rootless.patch +++ b/SOURCES/sos-bz1776549-podman-buildah-rootless.patch @@ -140,3 +140,80 @@ index da360c7e..92c2e9e8 100644 -- 2.21.3 +From 2b158a5c2a963c52cf5a96b27cc07c73b5829d59 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 9 Jul 2020 15:38:47 +0200 +Subject: [PATCH] [containers_common] collect user-related commands outputs + +podman and buildah commands should be collected on per-user basis, +as declared by rootlessusers plugin option. + +Resolves: #2145 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/plugins/containers_common.py | 36 ++++++++++++++++++------- + 1 file changed, 26 insertions(+), 10 deletions(-) + +diff --git a/sos/plugins/containers_common.py b/sos/plugins/containers_common.py +index 92c2e9e8..08962a94 100644 +--- a/sos/plugins/containers_common.py ++++ b/sos/plugins/containers_common.py +@@ -30,7 +30,6 @@ class ContainersCommon(Plugin, RedHatPlugin, UbuntuPlugin): + '/etc/subuid', + '/etc/subgid', + ]) +- self.add_cmd_output(['loginctl user-status']) + + users_opt = self.get_option('rootlessusers') + users_list = [] +@@ -38,19 +37,36 @@ class ContainersCommon(Plugin, RedHatPlugin, UbuntuPlugin): + users_list = [x for x in users_opt.split(':') if x] + + user_subcmds = [ +- 'info', +- 'unshare cat /proc/self/uid_map', +- 'unshare cat /proc/self/gid_map' ++ 'podman info', ++ 'podman unshare cat /proc/self/uid_map', ++ 'podman unshare cat /proc/self/gid_map', ++ 'podman images', ++ 'podman pod ps', ++ 'podman port --all', ++ 'podman ps', ++ 'podman ps -a', ++ 'podman stats --no-stream --all', ++ 'podman version', ++ 'podman volume ls', ++ 'buildah info', ++ 'buildah unshare cat /proc/self/uid_map', ++ 'buildah unshare cat /proc/self/gid_map', ++ 'buildah containers', ++ 'buildah containers --all', ++ 'buildah images', ++ 'buildah images --all', ++ 'buildah version', + ] + for user in users_list: + # collect user's containers' config + self.add_copy_spec( + '%s/.config/containers/' % (os.path.expanduser('~%s' % user))) +- # collect the user's podman/buildah info and uid/guid maps +- for binary in ['/usr/bin/podman', '/usr/bin/buildah']: +- for cmd in user_subcmds: +- self.add_cmd_output([ +- 'machinectl -q shell %s@ %s %s' % (user, binary, cmd) +- ], foreground=True) ++ # collect user-status ++ self.add_cmd_output('loginctl user-status %s' % user) ++ # collect the user's related commands ++ self.add_cmd_output([ ++ 'machinectl -q shell %s@ /usr/bin/%s' % (user, cmd) ++ for cmd in user_subcmds ++ ], foreground=True) + + # vim: set et ts=4 sw=4 : +-- +2.26.2 + diff --git a/SOURCES/sos-bz1850554-luks-not-detected.patch b/SOURCES/sos-bz1850554-luks-not-detected.patch new file mode 100644 index 0000000..b8bd7b6 --- /dev/null +++ b/SOURCES/sos-bz1850554-luks-not-detected.patch @@ -0,0 +1,29 @@ +From b85039b9ed658a4a59c637552a67ca9f2cf843b1 Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Wed, 24 Jun 2020 10:06:31 -0400 +Subject: [PATCH] [block] Fix typo in LUKS detection + +Fixes a typo in detecting LUKS partitions for cryptsetup output +collection. + +Signed-off-by: Jake Hunsaker +--- + sos/plugins/block.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/block.py b/sos/plugins/block.py +index 2af25e7a..69548af6 100644 +--- a/sos/plugins/block.py ++++ b/sos/plugins/block.py +@@ -52,7 +52,7 @@ class Block(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + # for LUKS devices, collect cryptsetup luksDump + if lsblk['status'] == 0: + for line in lsblk['output'].splitlines(): +- if 'crypto LUKS' in line: ++ if 'crypto_LUKS' in line: + dev = line.split()[0] + self.add_cmd_output('cryptsetup luksDump /dev/%s' % dev) + +-- +2.26.2 + diff --git a/SOURCES/sos-bz1850926-logs-no-journal.patch b/SOURCES/sos-bz1850926-logs-no-journal.patch new file mode 100644 index 0000000..bbe927f --- /dev/null +++ b/SOURCES/sos-bz1850926-logs-no-journal.patch @@ -0,0 +1,54 @@ +From 8c2b07adeebed573306bc52a26b37b6def75a925 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Tue, 7 Jul 2020 18:57:15 +0200 +Subject: [PATCH] [logs] collect also non-persistent journal logs + +Collect journalctl logs also when journal is configured to store logs +in memory only. + +Further, apply --since option to journal catalog logs. + +Further, when --all-logs is provided, collect the transient logs in +/var/log/journal dir as well. + +Resolves: #2130 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/logs.py | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py +index c92cc1f0..e3b6b884 100644 +--- a/sos/plugins/logs.py ++++ b/sos/plugins/logs.py +@@ -59,13 +59,21 @@ class Logs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, CosPlugin): + self.add_cmd_output("journalctl --disk-usage") + self.add_cmd_output('ls -alRh /var/log/') + +- journal = os.path.exists("/var/log/journal/") +- if journal and self.is_installed("systemd"): ++ # collect journal logs if: ++ # - there is some data present, either persistent or runtime only ++ # - systemd-journald service exists ++ # otherwise fallback to collecting few well known logfiles directly ++ journal = any([os.path.exists(p + "/log/journal/") ++ for p in ["/var", "/run"]]) ++ if journal and self.is_service("systemd-journald"): + self.add_journal(since=since) +- self.add_journal(boot="this", catalog=True) +- self.add_journal(boot="last", catalog=True) ++ self.add_journal(boot="this", catalog=True, since=since) ++ self.add_journal(boot="last", catalog=True, since=since) + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/journal/*") ++ self.add_copy_spec([ ++ "/var/log/journal/*", ++ "/run/log/journal/*" ++ ]) + else: # If not using journal + if not self.get_option("all_logs"): + self.add_copy_spec([ +-- +2.26.2 + diff --git a/SOURCES/sos-bz1851923-powerpc-missing-logs.patch b/SOURCES/sos-bz1851923-powerpc-missing-logs.patch new file mode 100644 index 0000000..8ea8c8d --- /dev/null +++ b/SOURCES/sos-bz1851923-powerpc-missing-logs.patch @@ -0,0 +1,36 @@ +From 1368498e8d5c5e2d9cd93c335252efe8e08316a4 Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Thu, 30 Apr 2020 14:05:21 -0400 +Subject: [PATCH] [Plugin] Fix enablement triggers when only restriction is + architecture + +When a plugin, such as the `powerpc` plugin, only defines an +architecture enablement trigger and no files, commands, packages, etc... +our current enablement checks would return false. When the 'normal' +trigger restrictions are all empty, but there is an architecture +trigger, now properly enable based solely on that architecture. + +Signed-off-by: Jake Hunsaker +--- + sos/plugins/__init__.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index 011113b0..c632d5e4 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -1775,6 +1775,11 @@ class Plugin(object): + return True + + def _check_plugin_triggers(self, files, packages, commands, services): ++ ++ if not any([files, packages, commands, services]): ++ # no checks beyond architecture restrictions ++ return self.check_is_architecture() ++ + return ((any(os.path.exists(fname) for fname in files) or + any(self.is_installed(pkg) for pkg in packages) or + any(is_executable(cmd) for cmd in commands) or +-- +2.26.2 + diff --git a/SOURCES/sos-bz1853700-pci-too-strong-condition.patch b/SOURCES/sos-bz1853700-pci-too-strong-condition.patch new file mode 100644 index 0000000..051cbc5 --- /dev/null +++ b/SOURCES/sos-bz1853700-pci-too-strong-condition.patch @@ -0,0 +1,54 @@ +From c5a3dd0fb1e256772d83f19bc458e79b2cf5baf7 Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Fri, 3 Jul 2020 12:24:10 -0400 +Subject: [PATCH] [pci] Update gating for lspci commands + +It was reported that certain arches may create subdir structures under +/proc/bus/pci differently than others - most notably that the first +device subdir could be '0000:00' instead of just '00'. + +Rather than chase these different layouts, update the gating check for +running `lspci` commands to being that /proc/bus/pci exists and it has +more than just the `devices` file present, as this file may be present +but empty when nothing else exists under `/proc/bus/pci`. + +This is the legacy-3.9 backport from #2138 + +Signed-off-by: Jake Hunsaker +--- + sos/plugins/pci.py | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/pci.py b/sos/plugins/pci.py +index ac90f09d..053307cd 100644 +--- a/sos/plugins/pci.py ++++ b/sos/plugins/pci.py +@@ -17,6 +17,16 @@ class Pci(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): + plugin_name = "pci" + profiles = ('hardware', 'system') + ++ def check_for_bus_devices(self): ++ if not os.path.isdir('/proc/bus/pci'): ++ return False ++ # ensure that more than just the 'devices' file, which can be empty, ++ # exists in the pci directory. This implies actual devices are present ++ content = os.listdir('/proc/bus/pci') ++ if 'devices' in content: ++ content.remove('devices') ++ return len(content) > 0 ++ + def setup(self): + self.add_copy_spec([ + "/proc/ioports", +@@ -24,7 +34,7 @@ class Pci(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): + "/proc/bus/pci" + ]) + +- if os.path.isdir("/proc/bus/pci/00"): ++ if self.check_for_bus_devices(): + self.add_cmd_output("lspci -nnvv", root_symlink="lspci") + self.add_cmd_output("lspci -tv") + +-- +2.26.2 + diff --git a/SOURCES/sos-bz1857590-gluster-removes-sockfiles.patch b/SOURCES/sos-bz1857590-gluster-removes-sockfiles.patch new file mode 100644 index 0000000..6fffc6c --- /dev/null +++ b/SOURCES/sos-bz1857590-gluster-removes-sockfiles.patch @@ -0,0 +1,82 @@ +From 2b46bf710ff266a5727f5c101872c778d470dcb4 Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Wed, 15 Jul 2020 13:38:52 +0200 +Subject: [PATCH] [gluster] remove only dump files + +Removes only dump files and leaving +other files as .socket or sock. + +Resolves: #2152 + +Signed-off-by: Jan Jansky +Signed-off-by: Jake Hunsaker +--- + sos/plugins/gluster.py | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py +index 9540d323..9815bbe7 100644 +--- a/sos/plugins/gluster.py ++++ b/sos/plugins/gluster.py +@@ -40,15 +40,14 @@ class Gluster(Plugin, RedHatPlugin): + ret = string.count(last_line, 'DUMP_END_TIME') + + def postproc(self): +- if not os.path.exists(self.statedump_dir): +- return +- try: +- for dirs in os.listdir(self.statedump_dir): +- os.remove(os.path.join(self.statedump_dir, dirs)) +- os.rmdir(self.statedump_dir) +- os.unlink('/tmp/glusterdump.options') +- except OSError: +- pass ++ if self.get_option("dump"): ++ if not os.path.exists(self.statedump_dir): ++ return ++ try: ++ for name in glob.glob(self.statedump_dir + '/*.dump.[0-9]*'): ++ os.remove(name) ++ except OSError: ++ pass + + def setup(self): + self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem") +-- +2.26.2 + +From 7994ea1cc22ae256f08426ef37931b7b58f0fefc Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Thu, 16 Jul 2020 14:34:49 +0200 +Subject: [PATCH] [gluster] remove generated state files + +Remove also generated state files in +/run/gluster. + +Resolves: #2154 + +Signed-off-by: Jan Jansky +Signed-off-by: Jake Hunsaker +--- + sos/plugins/gluster.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py +index 9815bbe7..7b6a9298 100644 +--- a/sos/plugins/gluster.py ++++ b/sos/plugins/gluster.py +@@ -45,7 +45,10 @@ class Gluster(Plugin, RedHatPlugin): + if not os.path.exists(self.statedump_dir): + return + try: +- for name in glob.glob(self.statedump_dir + '/*.dump.[0-9]*'): ++ remove_files = glob.glob(self.statedump_dir + '/*.dump.[0-9]*') ++ remove_files.extend(glob.glob(self.statedump_dir + ++ '/glusterd_state_[0-9]*_[0-9]*')) ++ for name in remove_files: + os.remove(name) + except OSError: + pass +-- +2.26.2 + diff --git a/SOURCES/sos-bz1859888-kubernetes-indexerror-on-nodes.patch b/SOURCES/sos-bz1859888-kubernetes-indexerror-on-nodes.patch new file mode 100644 index 0000000..06d76c4 --- /dev/null +++ b/SOURCES/sos-bz1859888-kubernetes-indexerror-on-nodes.patch @@ -0,0 +1,37 @@ +From 482029d991e1aa075aafb122cbeee911afad341c Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 23 Jul 2020 15:35:31 +0200 +Subject: [PATCH] [kubernetes] ignore blank+empty lines in "kubectl get nodes" + output + +In a theoretical case when the command output contains empty or blank +line, we must skip them before finding the first word there. + +Resolves: #2162 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/plugins/kubernetes.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/kubernetes.py b/sos/plugins/kubernetes.py +index 03f2c498..5f21fa3d 100644 +--- a/sos/plugins/kubernetes.py ++++ b/sos/plugins/kubernetes.py +@@ -105,7 +105,11 @@ class Kubernetes(Plugin): + nodes = self.collect_cmd_output("%s get nodes" % self.kube_cmd) + if nodes['status'] == 0: + for line in nodes['output'].splitlines()[1:]: +- node = line.split()[0] ++ # find first word in the line and ignore empty+blank lines ++ words = line.split() ++ if not words: ++ continue ++ node = words[0] + self.add_cmd_output( + "%s describe node %s" % (self.kube_cmd, node), + subdir='nodes' +-- +2.26.2 + diff --git a/SPECS/sos.spec b/SPECS/sos.spec index e8659e3..cffff05 100644 --- a/SPECS/sos.spec +++ b/SPECS/sos.spec @@ -5,7 +5,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 3.9.1 -Release: 4%{?dist} +Release: 5%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source1: sos-audit-%{auditversion}.tgz @@ -33,6 +33,12 @@ Patch10: sos-bz1843562-gluster-volume-specific.patch Patch11: sos-bz1844853-nfs-etc-exports.patch Patch12: sos-bz1845386-pacemaker-passwords-with-equal-sign.patch Patch13: sos-bz1843754-powerpc-logs-for-components.patch +Patch14: sos-bz1850926-logs-no-journal.patch +Patch15: sos-bz1850554-luks-not-detected.patch +Patch16: sos-bz1851923-powerpc-missing-logs.patch +Patch17: sos-bz1853700-pci-too-strong-condition.patch +Patch18: sos-bz1857590-gluster-removes-sockfiles.patch +Patch19: sos-bz1859888-kubernetes-indexerror-on-nodes.patch %description Sos is a set of tools that gathers information about system @@ -55,6 +61,12 @@ support technicians and developers. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 %setup -T -D -a1 -q %build @@ -107,6 +119,22 @@ of the system. Currently storage and filesystem commands are audited. %ghost /etc/audit/rules.d/40-sos-storage.rules %changelog +* Fri Jul 24 2020 Pavel Moravec = 3.9.1-5 +- [logs] collect also non-persistent journal logs + Resolves: bz1850926 +- [block] Fix typo in LUKS detection + Resolves: bz1850554 +- [powerpc] Fix enablement triggers + Resolves: bz1851923 +- [pci] Update gating for lspci commands + Resolves: bz1853700 +- [containers_common] collect user-related commands outputs + Resolves: bz1776549 +- [gluster] remove only dump files + generated state files + Resolves: bz1857590 +- [kubernetes] ignore blank+empty lines in "kubectl get nodes" + Resolves: bz1859888 + * Tue Jun 23 2020 Pavel Moravec = 3.9.1-4 - [gluster] fix gluster volume splitlines iteration Resolves: bz1843562