stopping podman container
Hello, I'm facing the following small issue while stopping a podman container on RedHat 8.9 and SuSE SLES 15SP4. Inside the container runs also a SuSE SLES 15SP4: $ podman run -d -p 2022:22 -p 28076:8076 -p 23045:3045 7c180cc3c676 c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 ... $ podman stop c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 WARN[0010] StopSignal SIGQUIT failed to stop container vibrant_bartik in 10 seconds, resorting to SIGKILL c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 The Dockerfile which is used to build the container end with: $ tail -5 suse/Dockerfile EXPOSE 22 8076 3045 ENTRYPOINT /usr/local/bin/start.sh STOPSIGNAL SIGQUIT Any ideas what I do wrong? matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.
On 2/23/24 5:20 AM, Matthias Apitz wrote:
Hello,
I'm facing the following small issue while stopping a podman container on RedHat 8.9 and SuSE SLES 15SP4. Inside the container runs also a SuSE SLES 15SP4:
$ podman run -d -p 2022:22 -p 28076:8076 -p 23045:3045 7c180cc3c676 c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
...
$ podman stop c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 WARN[0010] StopSignal SIGQUIT failed to stop container vibrant_bartik in 10 seconds, resorting to SIGKILL c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
The Dockerfile which is used to build the container end with:
$ tail -5 suse/Dockerfile EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
Any ideas what I do wrong?
matthias
Most likely the program running in start.sh is ignoreing the SIGSTOP signal.
El día viernes, febrero 23, 2024 a las 06:06:18 -0500, Daniel Walsh escribió:
On 2/23/24 5:20 AM, Matthias Apitz wrote:
Hello,
I'm facing the following small issue while stopping a podman container on RedHat 8.9 and SuSE SLES 15SP4. Inside the container runs also a SuSE SLES 15SP4:
$ podman run -d -p 2022:22 -p 28076:8076 -p 23045:3045 7c180cc3c676 c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
...
$ podman stop c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 WARN[0010] StopSignal SIGQUIT failed to stop container vibrant_bartik in 10 seconds, resorting to SIGKILL c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
The Dockerfile which is used to build the container end with:
$ tail -5 suse/Dockerfile EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
Any ideas what I do wrong?
matthias
Most likely the program running in start.sh is ignoreing the SIGSTOP signal.
The start.sh gets build from Dockerfile in the image: ... RUN echo "/etc/init.d/postgres start" >> /usr/local/bin/start.sh RUN echo "/usr/local/bin/initSunRise.sh" >> /usr/local/bin/start.sh RUN echo "/usr/sbin/sshd -D" >> /usr/local/bin/start.sh RUN chmod 0755 /usr/local/bin/start.sh EXPOSE 22 8076 3045 ENTRYPOINT /usr/local/bin/start.sh STOPSIGNAL SIGQUIT The script /etc/init.d/postgres starts the PostgreSQL server. The script /usr/local/bin/initSunRise.sh loads a database dump into the server with: export LD_LIBRARY_PATH=/usr/local/sisis-pap/lib printf "CREATE ROLE sisis WITH SUPERUSER CREATEDB LOGIN PASSWORD 'sisis123' ;\n" | /usr/local/sisis-pap/pgsql/bin/psql -U postgres >> /home/sisis/err 2>&1 /usr/local/sisis-pap/pgsql/bin/createdb -U sisis -T template0 sisis >> /home/sisis/err 2>&1 cd /home/sisis nohup sh -c 'gzip -dc /home/sisis/dump/testdb.dmp.gz | /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis >> /home/sisis/err 2>&1 ; /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis < ~sisis/sc/PosUpdSeq.sql >> /home/sisis/err 2>&1' & and the processes will end, when the dump is loaded; at the moment I started the container again and I see it run fine: $ podman run -d -p 2022:22 -p 8076:8076 -p 3045:3045 suse 3459e118898dc575c9d07bc7dcfdb13fe2f7d3f9e9868b151271b55fb3241617 $ ssh -p 2022 root@localhost root@localhost's password: 459e118898d:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 30 ? S 0:00 /usr/local/sisis-pap/pgsql-15.1/bin/postmaster -D / 33 ? Ss 0:00 postgres: logger 34 ? Ss 0:00 postgres: checkpointer 35 ? Ss 0:00 postgres: background writer 37 ? Ss 0:00 postgres: walwriter 38 ? Ss 0:00 postgres: autovacuum launcher 39 ? Ss 0:00 postgres: logical replication launcher 45 ? S 0:00 sh -c gzip -dc /home/sisis/dump/testdb.dmp.gz | /us 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 star 47 ? R 0:02 gzip -dc /home/sisis/dump/testdb.dmp.gz 48 ? S 0:00 /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis 49 ? Rs 0:16 postgres: sisis sisis [local] COPY 50 ? Rs 0:00 sshd: root@pts/0 52 pts/0 Ss 0:00 -bash 85 pts/0 R+ 0:00 ps ax When the load is finished after ~3 minutes it looks like this: 3459e118898d:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 30 ? S 0:00 /usr/local/sisis-pap/pgsql-15.1/bin/postmaster -D / 33 ? Ss 0:00 postgres: logger 34 ? Ss 0:00 postgres: checkpointer 35 ? Ss 0:00 postgres: background writer 37 ? Ss 0:01 postgres: walwriter 38 ? Ss 0:00 postgres: autovacuum launcher 39 ? Ss 0:00 postgres: logical replication launcher 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 star 50 ? Ds 0:00 sshd: root@pts/0 52 pts/0 Ss 0:00 -bash 290 pts/0 R+ 0:00 ps ax i.e. only the PostgreSQL server is running (postmaster and its children postgres) and the sshd and my ssh session. Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.
On Fri, Feb 23, 2024 at 02:43:48PM +0100, Matthias Apitz wrote:
El día viernes, febrero 23, 2024 a las 06:06:18 -0500, Daniel Walsh escribió:
On 2/23/24 5:20 AM, Matthias Apitz wrote:
Hello,
I'm facing the following small issue while stopping a podman container on RedHat 8.9 and SuSE SLES 15SP4. Inside the container runs also a SuSE SLES 15SP4:
$ podman run -d -p 2022:22 -p 28076:8076 -p 23045:3045 7c180cc3c676 c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
...
$ podman stop c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882 WARN[0010] StopSignal SIGQUIT failed to stop container vibrant_bartik in 10 seconds, resorting to SIGKILL c408e9d468cdebbc11a2d974ccf40e315fa724ada702e713359019a25b2b6882
The Dockerfile which is used to build the container end with:
$ tail -5 suse/Dockerfile EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
Any ideas what I do wrong?
matthias
Most likely the program running in start.sh is ignoreing the SIGSTOP signal.
The start.sh gets build from Dockerfile in the image:
... RUN echo "/etc/init.d/postgres start" >> /usr/local/bin/start.sh RUN echo "/usr/local/bin/initSunRise.sh" >> /usr/local/bin/start.sh RUN echo "/usr/sbin/sshd -D" >> /usr/local/bin/start.sh RUN chmod 0755 /usr/local/bin/start.sh
EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
You know, I was pretty confused by your situation until I saw that line. :) man bash: 3.7.6 Signals When Bash is interactive, in the absence of any traps, it ignores SIGTERM (so that ‘kill 0’ does not kill an interactive shell), and SIGINT is caught and handled (so that the wait builtin is interruptible). When Bash receives a SIGINT, it breaks out of any executing loops. In all cases, Bash ignores SIGQUIT.
The script /etc/init.d/postgres starts the PostgreSQL server. The script /usr/local/bin/initSunRise.sh loads a database dump into the server with:
export LD_LIBRARY_PATH=/usr/local/sisis-pap/lib
printf "CREATE ROLE sisis WITH SUPERUSER CREATEDB LOGIN PASSWORD 'sisis123' ;\n" | /usr/local/sisis-pap/pgsql/bin/psql -U postgres >> /home/sisis/err 2>&1
/usr/local/sisis-pap/pgsql/bin/createdb -U sisis -T template0 sisis >> /home/sisis/err 2>&1
cd /home/sisis nohup sh -c 'gzip -dc /home/sisis/dump/testdb.dmp.gz | /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis >> /home/sisis/err 2>&1 ; /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis < ~sisis/sc/PosUpdSeq.sql >> /home/sisis/err 2>&1' &
and the processes will end, when the dump is loaded; at the moment I started the container again and I see it run fine:
$ podman run -d -p 2022:22 -p 8076:8076 -p 3045:3045 suse 3459e118898dc575c9d07bc7dcfdb13fe2f7d3f9e9868b151271b55fb3241617 $ ssh -p 2022 root@localhost root@localhost's password:
459e118898d:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 30 ? S 0:00 /usr/local/sisis-pap/pgsql-15.1/bin/postmaster -D / 33 ? Ss 0:00 postgres: logger 34 ? Ss 0:00 postgres: checkpointer 35 ? Ss 0:00 postgres: background writer 37 ? Ss 0:00 postgres: walwriter 38 ? Ss 0:00 postgres: autovacuum launcher 39 ? Ss 0:00 postgres: logical replication launcher 45 ? S 0:00 sh -c gzip -dc /home/sisis/dump/testdb.dmp.gz | /us 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 star 47 ? R 0:02 gzip -dc /home/sisis/dump/testdb.dmp.gz 48 ? S 0:00 /usr/local/sisis-pap/pgsql/bin/psql -Usisis sisis 49 ? Rs 0:16 postgres: sisis sisis [local] COPY 50 ? Rs 0:00 sshd: root@pts/0 52 pts/0 Ss 0:00 -bash 85 pts/0 R+ 0:00 ps ax
When the load is finished after ~3 minutes it looks like this:
3459e118898d:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 30 ? S 0:00 /usr/local/sisis-pap/pgsql-15.1/bin/postmaster -D / 33 ? Ss 0:00 postgres: logger 34 ? Ss 0:00 postgres: checkpointer 35 ? Ss 0:00 postgres: background writer 37 ? Ss 0:01 postgres: walwriter 38 ? Ss 0:00 postgres: autovacuum launcher 39 ? Ss 0:00 postgres: logical replication launcher 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 star 50 ? Ds 0:00 sshd: root@pts/0 52 pts/0 Ss 0:00 -bash 290 pts/0 R+ 0:00 ps ax
i.e. only the PostgreSQL server is running (postmaster and its children postgres) and the sshd and my ssh session.
Thanks
matthias
-- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub
I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland. _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
El día viernes, febrero 23, 2024 a las 08:24:58 -0800, Robin Lee Powell via Podman escribió:
On Fri, Feb 23, 2024 at 02:43:48PM +0100, Matthias Apitz wrote:
The Dockerfile which is used to build the container end with:
$ tail -5 suse/Dockerfile EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
Any ideas what I do wrong?
matthias
Most likely the program running in start.sh is ignoreing the SIGSTOP signal.
The start.sh gets build from Dockerfile in the image:
... RUN echo "/etc/init.d/postgres start" >> /usr/local/bin/start.sh RUN echo "/usr/local/bin/initSunRise.sh" >> /usr/local/bin/start.sh RUN echo "/usr/sbin/sshd -D" >> /usr/local/bin/start.sh RUN chmod 0755 /usr/local/bin/start.sh
EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
You know, I was pretty confused by your situation until I saw that line. :)
There must be something more magic. This is inside the container: 26ef31df12f6:~ # /etc/init.d/postgres stop Stopping PostgreSQL: ok 26ef31df12f6:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups 180 ? Rs 0:00 sshd: root@pts/0 182 pts/0 Ss 0:00 -bash 217 pts/0 R+ 0:00 ps ax 26ef31df12f6:~ # cat /usr/local/bin/start.sh /etc/init.d/postgres start /usr/local/bin/initSunRise.sh /usr/sbin/sshd -D 26ef31df12f6:~ # kill -9 1 Nothing happens. The proc 1 keeps running. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.
On Mon, Feb 26, 2024 at 07:19:48AM +0100, Matthias Apitz wrote:
El día viernes, febrero 23, 2024 a las 08:24:58 -0800, Robin Lee Powell via Podman escribió:
On Fri, Feb 23, 2024 at 02:43:48PM +0100, Matthias Apitz wrote:
The Dockerfile which is used to build the container end with:
$ tail -5 suse/Dockerfile EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
Any ideas what I do wrong?
matthias
Most likely the program running in start.sh is ignoreing the SIGSTOP signal.
The start.sh gets build from Dockerfile in the image:
... RUN echo "/etc/init.d/postgres start" >> /usr/local/bin/start.sh RUN echo "/usr/local/bin/initSunRise.sh" >> /usr/local/bin/start.sh RUN echo "/usr/sbin/sshd -D" >> /usr/local/bin/start.sh RUN chmod 0755 /usr/local/bin/start.sh
EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
You know, I was pretty confused by your situation until I saw that line. :)
There must be something more magic. This is inside the container:
26ef31df12f6:~ # /etc/init.d/postgres stop Stopping PostgreSQL: ok 26ef31df12f6:~ # ps ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /bin/sh -c /usr/local/bin/start.sh 46 ? S 0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups 180 ? Rs 0:00 sshd: root@pts/0 182 pts/0 Ss 0:00 -bash 217 pts/0 R+ 0:00 ps ax 26ef31df12f6:~ # cat /usr/local/bin/start.sh /etc/init.d/postgres start /usr/local/bin/initSunRise.sh /usr/sbin/sshd -D 26ef31df12f6:~ # kill -9 1
Nothing happens. The proc 1 keeps running.
That's because of https://unix.stackexchange.com/a/457650/52312 ; killing the sshd process (46 in your example) should do fine. Side comment: I don't actually recommend running sshd in containers; it tends to lead to thinking incorrectly about how to use containers and what they're for. Use `podman exec` instead. Example: rlpowell@stodi> cat Dockerfile FROM docker.io/library/debian:bullseye COPY crap.sh /tmp/crap.sh ENTRYPOINT bash /tmp/crap.sh rlpowell@stodi> docker run --rm -it bashtest In another window: rlpowell@stodi> podman exec -it charming_goldstine bash root@80d44555a09b:/# ps afux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 4 0.0 0.0 4032 3216 pts/1 Ss 06:35 0:00 bash root 341 0.0 0.0 6760 2912 pts/1 R+ 06:35 0:00 \_ ps afux root 1 0.0 0.0 2484 508 pts/0 Ss+ 06:35 0:00 /bin/sh -c bash /tmp/crap.sh root 2 0.0 0.0 3900 2684 pts/0 S+ 06:35 0:00 bash /tmp/crap.sh root 3 0.0 0.0 2396 496 pts/0 S+ 06:35 0:00 \_ sleep 9999 root@80d44555a09b:/# kill -9 1 root@80d44555a09b:/# ps afux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 4 0.0 0.0 4032 3216 pts/1 Ss 06:35 0:00 bash root 342 0.0 0.0 6760 2864 pts/1 R+ 06:35 0:00 \_ ps afux root 1 0.0 0.0 2484 508 pts/0 Ss+ 06:35 0:00 /bin/sh -c bash /tmp/crap.sh root 2 0.0 0.0 3900 2684 pts/0 S+ 06:35 0:00 bash /tmp/crap.sh root 3 0.0 0.0 2396 496 pts/0 S+ 06:35 0:00 \_ sleep 9999 root@80d44555a09b:/# kill -9 3 root@80d44555a09b:/# % rlpowell@stodi>
participants (3)
-
Daniel Walsh -
Matthias Apitz -
Robin Lee Powell