From: NeilBrown Date: Wed, 15 May 2013 01:10:54 +0000 (+1000) Subject: Suppress error messages from systemctl. X-Git-Tag: mdadm-3.3-rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=701d5b4ab5ad72f8998d4398d5b209fea877ce37;p=thirdparty%2Fmdadm.git 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 --- diff --git a/util.c b/util.c index 7e2bbad1..3d2c3f09 100644 --- a/util.c +++ b/util.c @@ -1745,6 +1745,11 @@ int start_mdmon(char *devnm) 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", devnm); status = execl("/usr/bin/systemctl", "systemctl", "start",