From e3283d1cd326f1778a4798e3a52b54f1f025dba4 Mon Sep 17 00:00:00 2001 From: Willy TARREAU Date: Wed, 1 Mar 2006 22:15:29 +0100 Subject: [PATCH] * daemon mode must imply 'quiet' and disable 'verbose' as stdout/stderr file descriptors are closed. --- haproxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/haproxy.c b/haproxy.c index c136ac652..4c22aebef 100644 --- a/haproxy.c +++ b/haproxy.c @@ -8047,10 +8047,15 @@ int main(int argc, char **argv) { signal(SIGTTOU, sig_pause); signal(SIGTTIN, sig_listen); + if (global.mode & MODE_DAEMON) { + global.mode &= ~MODE_VERBOSE; + global.mode |= MODE_QUIET; + } + /* MODE_QUIET can inhibit alerts and warnings below this line */ global.mode &= ~MODE_STARTING; - if (global.mode & MODE_QUIET) { + if ((global.mode & MODE_QUIET) && !(global.mode & MODE_VERBOSE)) { /* detach from the tty */ fclose(stdin); fclose(stdout); fclose(stderr); close(0); close(1); close(2);