Skip to content

tini childs dont't receive sigterm after docker stop #229

@ardenisov

Description

@ardenisov

Hello!
I have several ZEBRA daemons running in docker container with tini as entrypoint.
The problem is that all zebra daemons receive SIGKILL when container stopped..

ZEBRA processes in docker container for example:

ps -a
PID   USER     TIME  COMMAND
    1 root      0:00 /sbin/tini -vvv -- /usr/lib/frr/docker-start
    7 root      0:00 {docker-start} /bin/bash /usr/lib/frr/docker-start
   11 root      0:00 /usr/lib/frr/watchfrr zebra mgmtd bgpd staticd bfdd
   27 frr       0:01 /usr/lib/frr/zebra -d -F traditional -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl
   33 frr       0:00 /usr/lib/frr/mgmtd -d -F traditional
   35 frr       0:00 /usr/lib/frr/bgpd -d -F traditional -A 127.0.0.1
   42 frr       0:00 /usr/lib/frr/staticd -d -F traditional -A 127.0.0.1
   45 frr       0:02 /usr/lib/frr/bfdd -d -F traditional -A 127.0.0.1

All ZEBRA daemons have parent pid of tini (1):

cat /proc/27/status | grep PPid
PPid:	1
cat /proc/33/status | grep PPid
PPid:	1
cat /proc/35/status | grep PPid
PPid:	1
cat /proc/42/status | grep PPid
PPid:	1
cat /proc/45/status | grep PPid
PPid:	1

Another look to tini children:

pgrep -lP 1
7 /bin/bash
27 /usr/lib/frr/zebra
33 /usr/lib/frr/mgmtd
35 /usr/lib/frr/bgpd
42 /usr/lib/frr/staticd
45 /usr/lib/frr/bfdd

but only one process receive sigterm in tini logs

[DEBUG tini (1)] Passing signal: 'Terminated'
[TRACE tini (1)] No child to reap
[DEBUG tini (1)] Received SIGCHLD
[DEBUG tini (1)] Reaped child with pid: '7'
[INFO  tini (1)] Main child exited with signal (with signal 'Terminated')
[TRACE tini (1)] No child to reap
[TRACE tini (1)] Exiting: child has exited

I expect that all tini children must receive SIGTERM not only PID 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions