From 8029300df64948cf2dbf87e4d71fb6c8d138d49d Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Mon, 6 Nov 2017 11:00:03 +0100 Subject: [PATCH] MINOR: mworker: allow pidfile in mworker + foreground This patch allows the use of the pidfile in master-worker mode without using the background option. --- src/haproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/haproxy.c b/src/haproxy.c index bbd26b82d..f12e903b2 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2499,7 +2499,7 @@ int main(int argc, char **argv) } /* open log & pid files before the chroot */ - if (global.mode & MODE_DAEMON && global.pidfile != NULL) { + if ((global.mode & MODE_DAEMON || global.mode & MODE_MWORKER) && global.pidfile != NULL) { unlink(global.pidfile); pidfd = open(global.pidfile, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (pidfd < 0) {