mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-06 10:11:00 +01:00
MINOR: mworker: only close std{in,out,err} in daemon mode
This allows to output messages when we are not in daemon mode which is useful to use log stdout in master worker mode.
This commit is contained in:
parent
3aac1068f7
commit
2e8fad9c30
@ -3201,12 +3201,16 @@ int main(int argc, char **argv)
|
|||||||
curpeers->peers_fe = NULL;
|
curpeers->peers_fe = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we're NOT in QUIET mode, we should now close the 3 first FDs to ensure
|
/*
|
||||||
* that we can detach from the TTY. We MUST NOT do it in other cases since
|
* This is only done in daemon mode because we might want the
|
||||||
* it would have already be done, and 0-2 would have been affected to listening
|
* logs on stdout in mworker mode. If we're NOT in QUIET mode,
|
||||||
* sockets
|
* we should now close the 3 first FDs to ensure that we can
|
||||||
|
* detach from the TTY. We MUST NOT do it in other cases since
|
||||||
|
* it would have already be done, and 0-2 would have been
|
||||||
|
* affected to listening sockets
|
||||||
*/
|
*/
|
||||||
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
|
if ((global.mode & MODE_DAEMON) &&
|
||||||
|
(!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
|
||||||
/* detach from the tty */
|
/* detach from the tty */
|
||||||
stdio_quiet(devnullfd);
|
stdio_quiet(devnullfd);
|
||||||
global.mode &= ~MODE_VERBOSE;
|
global.mode &= ~MODE_VERBOSE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user