SHA256
1
0
forked from pool/mdadm
mdadm/0004-Suppress-error-messages-from-systemctl.patch

31 lines
930 B
Diff
Raw Normal View History

References: bnc#821366
Git-commit: 701d5b4ab5ad72f8998d4398d5b209fea877ce37
From: NeilBrown <neilb@suse.de>
Date: Wed, 15 May 2013 11:10:54 +1000
Subject: [PATCH] Suppress error messages from systemctl.
We call systemctl to see if systemd will run mdmon for us.
If it cannot, we run mdmon directly, so we aren't interested
in the error message.
So redirect stderr to /dev/null.
Signed-off-by: NeilBrown <neilb@suse.de>
---
util.c | 5 +++++
1 file changed, 5 insertions(+)
--- mdadm-3.2.6.orig/util.c
+++ mdadm-3.2.6/util.c
@@ -1652,6 +1652,11 @@ int start_mdmon(int devnum)
else
skipped = 0;
+ /* Don't want to see error messages from systemctl.
+ * If the service doesn't exist, we start mdmon ourselves.
+ */
+ close(2);
+ open("/dev/null", O_WRONLY);
snprintf(pathbuf, sizeof(pathbuf), "mdmon@%s.service",
devnum2devname(devnum));
status = execl("/usr/bin/systemctl", "systemctl", "start",