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(a)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(a)lists.podman.io
> To unsubscribe send an email to podman-leave(a)lists.podman.io