diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2020-09-25 16:33:32 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2020-09-25 16:33:32 -0500 |
commit | 2355f1a3f2a4fd62cac6d9af0e94c8731acd4c0f (patch) | |
tree | 09c881035d6009cd773710193896f287e89825bf /src | |
parent | fbec1eed51c85c53b39f97a213479caa0a2b75ab (diff) |
supervise-daemon: only log debug logs when verbose mode is active
Diffstat (limited to 'src')
-rw-r--r-- | src/rc/supervise-daemon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index be424750..b3d63589 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -148,6 +148,7 @@ static char *fifopath = NULL; static int fifo_fd = 0; static char *pidfile = NULL; static char *svcname = NULL; +static bool verbose = false; extern char **environ; @@ -569,7 +570,8 @@ static void supervisor(char *exec, char **argv) buf[count] = 0; if (count == 0) continue; - syslog(LOG_DEBUG, "Received %s from fifo", buf); + if (verbose) + syslog(LOG_DEBUG, "Received %s from fifo", buf); if (strncasecmp(buf, "sig", 3) == 0) { if ((sscanf(buf, "%s %d", cmd, &sig_send) == 2) && (sig_send >= 0 && sig_send < NSIG)) { @@ -585,7 +587,8 @@ static void supervisor(char *exec, char **argv) if (do_healthcheck) { do_healthcheck = 0; alarm(0); - syslog(LOG_DEBUG, "running health check for %s", svcname); + if (verbose) + syslog(LOG_DEBUG, "running health check for %s", svcname); health_pid = exec_command("healthcheck"); health_status = rc_waitpid(health_pid); if (WIFEXITED(health_status) && WEXITSTATUS(health_status) == 0) @@ -904,6 +907,7 @@ int main(int argc, char **argv) case_RC_COMMON_GETOPT } + verbose = rc_yesno(getenv ("EINFO_VERBOSE")); endpwent(); argc -= optind; argv += optind; |