From 7643d09dca4d0eed97ba3c29d4f4fd1f037f96ae Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 25 Oct 2016 15:50:47 +0200 Subject: [PATCH] BUG/MINOR: systemd: make the wrapper return a non-null status code on error When execv() fails to execute the haproxy executable, it's important to return an error instead of pretending everything is cool. This fix should be backported to 1.6 and 1.5 in order to improve the overall reliability under systemd. --- src/haproxy-systemd-wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c index d118ec6ff..a78e75b36 100644 --- a/src/haproxy-systemd-wrapper.c +++ b/src/haproxy-systemd-wrapper.c @@ -94,7 +94,7 @@ static void spawn_haproxy(char **pid_strv, int nb_pid) fprintf(stderr, "\n"); execv(argv[0], argv); - exit(0); + exit(1); } }