]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: systemd: must check the configuration using -Ws
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 26 Jul 2021 09:03:54 +0000 (11:03 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 26 Jul 2021 09:03:54 +0000 (11:03 +0200)
When doing a reload with a configuration which requires the
master-worker mode, the configuration check will fail because the check
is not done with -W/-Ws.

Example:
wla@kikyo:~/haproxy$ ./haproxy -Ws -c -f haproxy.cfg
Configuration file is valid
wla@kikyo:~/haproxy$ ./haproxy -c -f haproxy.cfg
[NOTICE]   (13153) : haproxy version is 2.5-dev2-4567b3-16
[NOTICE]   (13153) : path to executable is ./haproxy
[ALERT]    (13153) : config : Can't use a 'program' section without master worker mode.
[ALERT]    (13153) : config : Fatal errors found in configuration.

This patch fixes the issue by adding -Ws on the check command line.

Must be backported in all stable branches. (The file was previously in
contrib/systemd/haproxy.service.in).

admin/systemd/haproxy.service.in

index 05fc595796c479b444a804119235388142decab9..cb7bbda6cc51a5c04d3992873980c3081ca61eb2 100644 (file)
@@ -9,7 +9,7 @@ EnvironmentFile=-/etc/sysconfig/haproxy
 Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" "EXTRAOPTS=-S /run/haproxy-master.sock"
 ExecStartPre=@SBINDIR@/haproxy -f $CONFIG -c -q $EXTRAOPTS
 ExecStart=@SBINDIR@/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS
-ExecReload=@SBINDIR@/haproxy -f $CONFIG -c -q $EXTRAOPTS
+ExecReload=@SBINDIR@/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS
 ExecReload=/bin/kill -USR2 $MAINPID
 KillMode=mixed
 Restart=always