commit cca61e69995676efe08a05536ffb76b07091255c 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 (cherry picked from commit c19a95d2eb778662ba342ff5e6a966ec632687a4) diff --git a/paunch/utils/systemd.py b/paunch/utils/systemd.py index 4c70171..e982153 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