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