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>
This commit is contained in:
parent
5b905a7ec5
commit
701d5b4ab5
5
util.c
5
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",
|
||||
|
|
Loading…
Reference in New Issue