From: William Lallemand Date: Mon, 6 Nov 2017 10:00:03 +0000 (+0100) Subject: MINOR: mworker: allow pidfile in mworker + foreground X-Git-Tag: v1.8-rc3~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8029300df64948cf2dbf87e4d71fb6c8d138d49d;p=thirdparty%2Fhaproxy.git MINOR: mworker: allow pidfile in mworker + foreground This patch allows the use of the pidfile in master-worker mode without using the background option. --- diff --git a/src/haproxy.c b/src/haproxy.c index bbd26b82de..f12e903b28 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) {