Accepting request 459916 from openSUSE:Factory:zSystems

New fixes from IBM

OBS-URL: https://build.opensuse.org/request/show/459916
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=2
This commit is contained in:
Mark Post 2017-02-22 23:40:55 +00:00 committed by Git OBS Bridge
parent e6c7f5a26e
commit f7a512ba31
4 changed files with 218 additions and 0 deletions

View File

@ -0,0 +1,142 @@
Subject: [PATCH] [BZ 151594] dbginfo: Collect docker debug output.
From: Karsten Graul <kgraul@linux.vnet.ibm.com>
Description: dbginfo: Collect docker debug output.
Symptom: dbginfo.sh output does not contain docker debug output.
Problem: dbginfo.sh does not collect docker debug output.
Solution: Add invocation of docker debug commands to dbginfo.sh.
Reproduction: -
Upstream-ID: -
Problem-ID: 151594
Signed-off-by: Karsten Graul <kgraul@linux.vnet.ibm.com>
---
scripts/dbginfo.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 54 insertions(+), 4 deletions(-)
--- a/scripts/dbginfo.sh
+++ b/scripts/dbginfo.sh
@@ -2,7 +2,7 @@
#
# dbginfo.sh - Tool to collect runtime, configuration, and trace information
#
-# Copyright IBM Corp. 2002, 2016
+# Copyright IBM Corp. 2002, 2017
#
# Switching to neutral locale
@@ -18,7 +18,7 @@ readonly SCRIPTNAME="${0##*/}"
print_version() {
cat <<EOF
${SCRIPTNAME}: Debug information script version %S390_TOOLS_VERSION%
-Copyright IBM Corp. 2002, 2016
+Copyright IBM Corp. 2002, 2017
EOF
}
@@ -177,11 +177,14 @@ readonly OUTPUT_FILE_OVS="${WORKPATH}ope
# File that includes the KVM domain xml file
readonly OUTPUT_FILE_XML="${WORKPATH}domain_xml"
+# File that includes the docker inspect output
+readonly OUTPUT_FILE_DOCKER="${WORKPATH}docker_inspect.out"
+
# Mount point of the debug file system
readonly MOUNT_POINT_DEBUGFS="/sys/kernel/debug"
# The amount of steps running the whole collections
-readonly COLLECTION_COUNT=10
+readonly COLLECTION_COUNT=11
# The kernel version (e.g. '2' from 2.6.32 or '3' from 3.2.1)
readonly KERNEL_VERSION=$(uname -r 2>/dev/null | cut -d'.' -f1)
@@ -301,6 +304,8 @@ LOGFILES="\
/var/log/yum.log\
/var/log/openvswitch/ovs-vswitchd.log\
/var/log/openvswitch/ovsdb-server.log\
+ /var/run/docker/libcontainerd/containerd/events.log\
+ /run/containerd/events.log\
"
########################################
@@ -351,6 +356,9 @@ CONFIGFILES="\
/etc/xinet.d\
/etc/*release\
$(find /lib/modules -name modules.dep 2>/dev/null)\
+ /etc/docker\
+ /usr/lib/systemd\
+ /etc/apparmor.d\
"
########################################
@@ -436,6 +444,16 @@ CMDS="uname -a\
:systemctl --all --no-pager show\
:systemctl --all --no-pager list-units\
:systemctl --all --no-pager list-unit-files\
+ :docker info\
+ :docker images\
+ :docker network ls\
+ :docker ps\
+ :docker ps -a\
+ :docker stats --no-stream\
+ :docker version\
+ :systemctl status docker.service\
+ :df /var/lib/docker\
+ :df --inodes /var/lib/docker\
"
########################################
@@ -767,13 +785,43 @@ collect_domain_xml() {
}
########################################
+collect_docker() {
+ local item_list
+ local item
+
+ # call docker inspect for all containers
+ item_list=$(docker ps -qa)
+ if test -n "${item_list}"; then
+ pr_syslog_stdout "10a of ${COLLECTION_COUNT}: Collecting docker container output"
+ for item in ${item_list}; do
+ call_run_command "docker inspect ${item}" "${OUTPUT_FILE_DOCKER}"
+ done
+ else
+ pr_syslog_stdout "10a of ${COLLECTION_COUNT}: Collecting docker container output skipped"
+ fi
+
+ # call docker inspect for all networks
+ item_list=$(docker network ls -q)
+ if test -n "${item_list}"; then
+ pr_syslog_stdout "10b of ${COLLECTION_COUNT}: Collecting docker network output"
+ for item in ${item_list}; do
+ call_run_command "docker network inspect ${item}" "${OUTPUT_FILE_DOCKER}"
+ done
+ else
+ pr_syslog_stdout "10b of ${COLLECTION_COUNT}: Collecting docker network output skipped"
+ fi
+
+ pr_log_stdout " "
+}
+
+########################################
post_processing() {
local file_mtime
local file_mtime_epoche
local tmp_file
local file_name
- pr_syslog_stdout "10 of ${COLLECTION_COUNT}: Postprocessing"
+ pr_syslog_stdout "11 of ${COLLECTION_COUNT}: Postprocessing"
find "${WORKPATH}etc/libvirt/qemu/" -maxdepth 1 -name "*.xml" 2>/dev/null | while IFS= read -r file_name; do
file_mtime_epoche=$(stat --format=%Y "${file_name}")
@@ -1056,6 +1104,8 @@ collect_ovs
collect_domain_xml
+collect_docker
+
post_processing
create_package

View File

@ -0,0 +1,65 @@
Subject: [PATCH] [BZ 151416] mon_fsstatd: fix double free in error path and skip virtual fs
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Description: mon_fsstatd: fix double free in error path and skip virtual fs
Symptom: The daemon is stopped and the following messages can be found
in syslog: "statvfs error on /run/user/0: Permission denied"
and "double free or corruption (!prev)".
Problem: The error handling code for a failing statvfs() call erroneously
does an extra fclose(), conflicting with the later fclose().
Also, breaking out of the inner loop at this point doesn't make
sense, because there may be other mounted filesystems that would
be skipped.
The reason for the failing statvfs() (on /run/user/0) is a wrong
selinux context (when started via systemctl), and this error will
spam the syslog if we only fix the double free. Since /run/user/0
is a tmpfs, and mon_fsstatd is supposed to collect only physical
filesystem data, it is wrong to even try to access /run/user/0.
Solution: Remove the extra fclose(), replace the break with a continue,
and add tmpfs (and others) to the list of ignored virtual
filesystems.
Reproduction: Start mon_fsstatd via service/systemctl.
Upstream-ID: -
Problem-ID: 151416
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
mon_tools/mon_fsstatd.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
--- a/mon_tools/mon_fsstatd.c
+++ b/mon_tools/mon_fsstatd.c
@@ -323,16 +323,31 @@ static int fsstatd_do_work(void)
strncmp(ent->mnt_type, "none", 4) == 0 ||
strncmp(ent->mnt_type, "proc", 4) == 0 ||
strncmp(ent->mnt_type, "subfs", 5) == 0 ||
+ strncmp(ent->mnt_type, "nfsd", 4) == 0 ||
+ strncmp(ent->mnt_type, "tmpfs", 5) == 0 ||
+ strncmp(ent->mnt_type, "sysfs", 5) == 0 ||
+ strncmp(ent->mnt_type, "pstore", 6) == 0 ||
+ strncmp(ent->mnt_type, "cgroup", 6) == 0 ||
+ strncmp(ent->mnt_type, "mqueue", 6) == 0 ||
+ strncmp(ent->mnt_type, "devpts", 6) == 0 ||
+ strncmp(ent->mnt_type, "debugfs", 7) == 0 ||
+ strncmp(ent->mnt_type, "devtmpfs", 8) == 0 ||
+ strncmp(ent->mnt_type, "configfs", 8) == 0 ||
+ strncmp(ent->mnt_type, "selinuxfs", 9) == 0 ||
+ strncmp(ent->mnt_type, "hugetlbfs", 9) == 0 ||
+ strncmp(ent->mnt_type, "securityfs", 10) == 0 ||
+ strncmp(ent->mnt_type, "rpc_pipefs", 10) == 0 ||
+ strncmp(ent->mnt_type, "binfmt_misc", 11) == 0 ||
strncmp(ent->mnt_type, "ignore", 6) == 0)) {
ent = getmntent(mnttab);
continue;
}
result = statvfs(ent->mnt_dir, &buf);
if (result != 0) {
- fclose(mnttab);
syslog(LOG_ERR, "statvfs error on %s: %s\n",
ent->mnt_dir, strerror(errno));
- break;
+ ent = getmntent(mnttab);
+ continue;
}
if (buf.f_blocks > 0)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 22 20:29:57 UTC 2017 - mpost@suse.com
- Added the following patches (bsc#1026474)
- s390-tools-sles12sp3-mon_fsstatd-fix-double-free-in-error-path-and-skip-virtual-fs.patch
- s390-tools-sles12sp3-dbginfo-Collect-docker-debug-data.patch
-------------------------------------------------------------------
Mon Feb 20 17:05:45 UTC 2017 - mpost@suse.com

View File

@ -130,6 +130,8 @@ Patch27: s390-tools-sles12sp3-dasdfmt-08-Make-progress-output-reusable-an
Patch28: s390-tools-sles12sp3-dasdfmt-09-Add-command-line-argument-check.patch
Patch29: s390-tools-sles12sp3-dasdfmt-10-Add-expand-format-mode.patch
Patch30: s390-tools-sles12sp3-util_proc-fix-memory-allocation-error-messages.patch
Patch31: s390-tools-sles12sp3-mon_fsstatd-fix-double-free-in-error-path-and-skip-virtual-fs.patch
Patch32: s390-tools-sles12sp3-dbginfo-Collect-docker-debug-data.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: s390 s390x
@ -216,6 +218,8 @@ to list files and directories.
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
cp -vi %{S:22} CAUTION