MINOR: systemd: consider exit status 143 as successful
authorVincent Bernat <vincent@bernat.im>
Fri, 22 Jun 2018 18:57:03 +0000 (20:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Jul 2018 15:44:51 +0000 (17:44 +0200)
commit3b479bd5f5f50ce91cabed32bb26556313552d23
tree2b247d7693fd898fe29913cf060a5d4293c58d1c
parentbfd8eb590908f1f326d3da214197f0fff7788435
MINOR: systemd: consider exit status 143 as successful

The master process will exit with the status of the last worker. When
the worker is killed with SIGTERM, it is expected to get 143 as an
exit status. Therefore, we consider this exit status as normal from a
systemd point of view. If it happens when not stopping, the systemd
unit is configured to always restart, so it has no adverse effect.

This has mostly a cosmetic effect. Without the patch, stopping HAProxy
leads to the following status:

    â\97\8f haproxy.service - HAProxy Load Balancer
       Loaded: loaded (/lib/systemd/system/haproxy.service; disabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Fri 2018-06-22 20:35:42 CEST; 8min ago
         Docs: man:haproxy(1)
               file:/usr/share/doc/haproxy/configuration.txt.gz
      Process: 32715 ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS (code=exited, status=143)
      Process: 32714 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS)
     Main PID: 32715 (code=exited, status=143)

After the patch:

    â\97\8f haproxy.service - HAProxy Load Balancer
       Loaded: loaded (/lib/systemd/system/haproxy.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:haproxy(1)
               file:/usr/share/doc/haproxy/configuration.txt.gz
contrib/systemd/haproxy.service.in