diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c index b426f96c0..f6a9c852b 100644 --- a/src/haproxy-systemd-wrapper.c +++ b/src/haproxy-systemd-wrapper.c @@ -295,6 +295,16 @@ int main(int argc, char **argv) } } + /* return either exit code or signal+128 */ + if (WIFEXITED(status)) + status = WEXITSTATUS(status); + else if (WIFSIGNALED(status)) + status = 128 + WTERMSIG(status); + else if (WIFSTOPPED(status)) + status = 128 + WSTOPSIG(status); + else + status = 255; + fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: exit, haproxy RC=%d\n", status); return status;