]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mworker: allow pidfile in mworker + foreground
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 6 Nov 2017 10:00:03 +0000 (11:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Nov 2017 10:08:38 +0000 (11:08 +0100)
This patch allows the use of the pidfile in master-worker mode without
using the background option.

src/haproxy.c

index bbd26b82de0f3c69408c3c41b1804cdb9336f642..f12e903b286f8bf07f6428ae0fb049e9bc4bcb5f 100644 (file)
@@ -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) {