commit c19a95d2eb778662ba342ff5e6a966ec632687a4 Author: Cédric Jeanneret Date: Tue Oct 6 17:11:44 2020 +0200 Instruct systemd to accept 137 and 143 exit code It might happen a container takes time to stop its running process - it therefore will call "SIGTERM" or "SIGKILL", and conmon will return the actual process exit code. Since the exit code won't be 0, it will be marked as "failed" in systemd status. Note that 137 is, actually, SIGKILL (137-128 = 9) and 143 is SIGTERM (143-128 = 15). While systemd accepts actual SIGTERM by default, it doesn't recognize that 143 exit status. We therefore have to namely point to this status code. Also, by default, SIGKILL isn't accepted as a valid, successful exit status. This change will needs to be backported down to stable/train - and another one will be created against triple-ansible. Change-Id: Iffcfc8bd18a999ae6921a4131d40241df40050f1 diff --git a/paunch/utils/systemd.py b/paunch/utils/systemd.py index 325e3d8..0789df6 100644 --- a/paunch/utils/systemd.py +++ b/paunch/utils/systemd.py @@ -102,6 +102,7 @@ ExecStart=%(start_cmd)s ExecReload=/usr/bin/podman kill --signal HUP %(name)s ExecStop=/usr/bin/podman stop -t %(stop_grace_period)s %(name)s ExecStopPost=/usr/bin/podman stop -t %(stop_grace_period)s %(name)s +SuccessExitStatus=137 143 KillMode=none Type=forking PIDFile=/var/run/%(name)s.pid