Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Benjamin Marzinski
c4cfc5fa89 device-mapper-multipath-0.7.7-6.gitef6d98b
Add 0020-RHBZ-1631772-tweak-logging-style.patch
  * Stop multipathd commands from logging to syslog.
Resolves: bz #1631772
2019-01-15 16:48:17 -06:00
2 changed files with 69 additions and 1 deletions

View file

@ -0,0 +1,61 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 10 Oct 2018 13:01:08 -0500
Subject: [PATCH] RHBZ 1631772: tweak logging style
When multipathd commands are run, errors should be printed to stderr,
instead of syslog. Also, when the multipath is run and calls
device-mapper, device-mapper should log to stderr instead of stdout,
just like multipath does now.
Bugzilla: 1631772
Upstream-Commit: b7c5a3d89fa6076f1d26de39aade0344f09fefcf
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/devmapper.c | 8 ++++----
multipathd/main.c | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 8136d15..0433b49 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -80,11 +80,11 @@ dm_write_log (int level, const char *file, int line, const char *f, ...)
strftime(buff, sizeof(buff), "%b %d %H:%M:%S", tb);
buff[sizeof(buff)-1] = '\0';
- fprintf(stdout, "%s | ", buff);
+ fprintf(stderr, "%s | ", buff);
}
- fprintf(stdout, "libdevmapper: %s(%i): ", file, line);
- vfprintf(stdout, f, ap);
- fprintf(stdout, "\n");
+ fprintf(stderr, "libdevmapper: %s(%i): ", file, line);
+ vfprintf(stderr, f, ap);
+ fprintf(stderr, "\n");
} else {
condlog(level, "libdevmapper: %s(%i): ", file, line);
log_safe(level + 3, f, ap);
diff --git a/multipathd/main.c b/multipathd/main.c
index cc493c1..7cf5b40 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2975,6 +2975,7 @@ main (int argc, char *argv[])
logsink = -1;
break;
case 'k':
+ logsink = 0;
conf = load_config(DEFAULT_CONFIGFILE);
if (!conf)
exit(1);
@@ -3004,6 +3005,7 @@ main (int argc, char *argv[])
char * s = cmd;
char * c = s;
+ logsink = 0;
conf = load_config(DEFAULT_CONFIGFILE);
if (!conf)
exit(1);
--
2.17.2

View file

@ -1,6 +1,6 @@
Name: device-mapper-multipath
Version: 0.7.7
Release: 5.gitef6d98b%{?dist}
Release: 6.gitef6d98b%{?dist}
Summary: Tools to manage multipath devices using device-mapper
License: GPLv2
URL: http://christophe.varoqui.free.fr/
@ -29,6 +29,7 @@ Patch0016: 0016-RH-add-mpathconf.patch
Patch0017: 0017-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch
Patch0018: 0018-RH-warn-on-invalid-regex-instead-of-failing.patch
Patch0019: 0019-RH-reset-default-find_mutipaths-value-to-off.patch
Patch0020: 0020-RHBZ-1631772-tweak-logging-style.patch
# runtime
Requires: %{name}-libs = %{version}-%{release}
@ -131,6 +132,7 @@ device-mapper-multipath's libdmmp C API library
%patch0017 -p1
%patch0018 -p1
%patch0019 -p1
%patch0020 -p1
cp %{SOURCE1} .
%build
@ -246,6 +248,11 @@ fi
%{_pkgconfdir}/libdmmp.pc
%changelog
* Tue Jan 15 2019 Benjamin Marzinski <bmarzins@redhat.com> 0.7.7-6.gitef6d98b
- Add 0020-RHBZ-1631772-tweak-logging-style.patch
* Stop multipathd commands from logging to syslog.
- Resolves: bz #1631772
* Fri Sep 14 2018 Benjamin Marzinski <bmarzins@redhat.com> 0.7.7-5.gitef6d98b
- Add Conflicts for mdadm < 4.1-rc2.0.2 and udisks2 < 2.8.0-2
* Multipath udev rule update from 0.7.7-1 is incompatible with older versions