]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: systemd: Wait for network to be online
authorRyan O'Hara <rohara@redhat.com>
Mon, 15 Jun 2020 16:34:54 +0000 (11:34 -0500)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Jun 2020 19:31:10 +0000 (21:31 +0200)
Change systemd service file to wait for network to be completely
online. This solves two problems:

If haproxy is configured to bind to IP address(es) that are not yet
assigned, haproxy would previously fail. The workaround is to use
"option transparent".

If haproxy us configured to use a resolver to resolve servers via DNS,
haproxy would previously fail due to the fact that the network is not
fully online yet. This is the most compelling reason for this patch.

Signed-off-by: Ryan O'Hara <rohara@redhat.com>
Acked-by: Lukas Tribus <lukas@ltri.eu>
contrib/systemd/haproxy.service.in

index 9b7c3d1bbcad7811609bf23c887ca38a066aa3ba..05fc595796c479b444a804119235388142decab9 100644 (file)
@@ -1,6 +1,7 @@
 [Unit]
 Description=HAProxy Load Balancer
-After=network.target
+After=network-online.target
+Wants=network-online.target
 
 [Service]
 EnvironmentFile=-/etc/default/haproxy