From: Lukas Tribus Date: Tue, 21 Nov 2017 11:39:34 +0000 (+0100) Subject: BUG/MINOR: systemd: ignore daemon mode X-Git-Tag: v1.8.0~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f46bf95d2b4726d7f69a66824001bcdae0899b57;p=thirdparty%2Fhaproxy.git BUG/MINOR: systemd: ignore daemon mode Since we switched to notify mode in the systemd unit file in commit d6942c8, haproxy won't start if the daemon keyword is present in the configuration. This change makes sure that haproxy remains in foreground when using systemd mode and adds a note in the documentation. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index bb255be7e5..cc397e1884 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -680,7 +680,8 @@ crt-base daemon Makes the process fork into background. This is the recommended mode of operation. It is equivalent to the command line "-D" argument. It can be - disabled by the command line "-db" argument. + disabled by the command line "-db" argument. This option is ignored in + systemd mode. deviceatlas-json-file Sets the path of the DeviceAtlas JSON data file to be loaded by the API. diff --git a/src/haproxy.c b/src/haproxy.c index b39a95fe35..4596dbded3 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1363,7 +1363,7 @@ static void init(int argc, char **argv) else if (*flag == 'D') arg_mode |= MODE_DAEMON; else if (*flag == 'W' && flag[1] == 's') { - arg_mode |= MODE_MWORKER; + arg_mode |= MODE_MWORKER | MODE_FOREGROUND; #if defined(USE_SYSTEMD) global.tune.options |= GTUNE_USE_SYSTEMD; #else