]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: systemd: ignore daemon mode
authorLukas Tribus <lukas@ltri.eu>
Tue, 21 Nov 2017 11:39:34 +0000 (12:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Nov 2017 20:21:35 +0000 (21:21 +0100)
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.

doc/configuration.txt
src/haproxy.c

index bb255be7e58e72d9e568388ab5f59e83b29d1c9f..cc397e1884c09ddef774af656444ba5dee418859 100644 (file)
@@ -680,7 +680,8 @@ crt-base <dir>
 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 <path>
   Sets the path of the DeviceAtlas JSON data file to be loaded by the API.
index b39a95fe35dac60205cf6ca7616cc2d0e07cdfa7..4596dbded3b218b68e40f4679e3357bf1702340d 100644 (file)
@@ -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