]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
* daemon mode must imply 'quiet' and disable 'verbose' as
authorWilly TARREAU <willy@pcw.(none)>
Wed, 1 Mar 2006 21:15:29 +0000 (22:15 +0100)
committerWilly TARREAU <willy@pcw.(none)>
Wed, 1 Mar 2006 21:15:29 +0000 (22:15 +0100)
  stdout/stderr file descriptors are closed.

haproxy.c

index c136ac6524d8c083295695a8d8e1f5db5f41bde8..4c22aebef92bd54780851d948fc12a03a6db5e44 100644 (file)
--- 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);