From 53de2cf4354da65843104ea430d6fdf0375a0c64 Mon Sep 17 00:00:00 2001 From: Antonio Russo Date: Tue, 16 Feb 2016 11:22:48 -0800 Subject: [PATCH] Suppress successful putval responses to exec plugin exec plugins are never supposed to receive responses to putval commands. These responses are instead sent to STDOUT, which is often attached to /dev/null. Newer init systems, such as systemd, instead log these responses. This patch preserves the expected behavior by suppressing the response if and only if the destination is STDOUT. --- src/utils_cmd_putval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c index 7b0258c6..7b6a39d7 100644 --- a/src/utils_cmd_putval.c +++ b/src/utils_cmd_putval.c @@ -217,7 +217,8 @@ int handle_putval (FILE *fh, char *buffer) } /* while (*buffer != 0) */ /* Done parsing the options. */ - print_to_socket (fh, "0 Success: %i %s been dispatched.\n", + if (fh!=stdout) + print_to_socket (fh, "0 Success: %i %s been dispatched.\n", values_submitted, (values_submitted == 1) ? "value has" : "values have"); -- 2.11.0