Hello
When I try to stop a 9-based container such as rockylinux9 or ubi9 with podman, the following message appears.
Do you know the cause and solution?
●Command
$ podman container stop containername
●Message
StopSignal SIGTERM failed to stop container containername in 10 seconds, resorting to SIGKILL
●Host OS
・Rocky Linux 9.5 (Blue Onyx)
・podman version 5.2.2
Thank you in advance.
Ritov
December 31, 2024, 11:24am
2
Your process inside the container doesn’t honor the signal. The question is therefore, what process do you start inside the container (as PID 1).
I have checked several versions of 8 and 9. In all cases, bash is PID 1. I don’t know why only version 9 displays the following warning.
$ podman container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d7175e10a772 docker.io/rockylinux/rockylinux:9.5 /bin/bash 27 seconds ago Up 27 seconds con-9.5
46e45c847240 docker.io/rockylinux/rockylinux:8.10 /bin/bash 19 seconds ago Up 19 seconds con-8.10
7290bff8bf90 docker.io/rockylinux/rockylinux:9.1 /bin/bash 11 seconds ago Up 11 seconds con-9.1
2776197e4e5a docker.io/rockylinux/rockylinux:8.4 /bin/bash 5 seconds ago Up 5 seconds con-8.4
$ podman container top con-9.5
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 35.432794893s pts/0 0s /bin/bash
$ podman container top con-8.10
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 30.984995722s pts/0 0s /bin/bash
$ podman container top con-9.1
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 28.40745646s pts/0 0s /bin/bash
$ podman container top con-8.4
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
root 1 0 0.000 25.120534778s pts/0 0s /bin/bash
$
$ podman container stop con-9.5
WARN[0010] StopSignal SIGTERM failed to stop container con-9.5 in 10 seconds, resorting to SIGKILL
con-9.5
$ podman container stop con-8.10
con-8.10
$ podman container stop con-9.1
WARN[0010] StopSignal SIGTERM failed to stop container con-9.1 in 10 seconds, resorting to SIGKILL
con-9.1
$ podman container stop con-8.4
con-8.4
$ podman container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$
I was able to confirm that if I add “–stop-signal SIGHUP” when running the container (podman container run), it will terminate without warning when I run podman stop.
I thought this was because PID1 was bash and the TERM signal was ignored, but I don’t understand why the 8 series container terminated normally.
I checked “/proc/1/status” in 8 and 9.
8: SigIgn: 0000000000380004
9: SigIgn: 0000000000384004
Based on this alone, it seems that 9 ignores SIGTERM, but 8 does not. I thought this might be related.