Closed GenaANTG closed 3 years ago
this seems correct to me, dumb-init
receives the TERM
, sends it along to its subprocesses and then exits with whatever code they have (which most often will be 143 "exited due to unhandled TERM").
here's a small example using sleep
:
$ dumb-init -vvv sleep 10000; echo $?
[dumb-init] Detached from controlling tty, but was not session leader.
[dumb-init] Child spawned with PID 20277.
[dumb-init] Unable to attach to controlling tty (errno=1 Operation not permitted).
[dumb-init] setsid complete.
[dumb-init] Received signal 15.
[dumb-init] Forwarded signal 15 to children.
[dumb-init] Received signal 17.
[dumb-init] A child with PID 20277 was terminated by signal 15.
[dumb-init] Forwarded signal 15 to children.
[dumb-init] Child exited with status 143. Goodbye.
143
(note that in the other terminal I ran kill -TERM 123123
where 123123
is the pid of dumb-init
you can further validate by running dumb-init
with more --verbose
flags
@asottile Thanks mate! I have already complete read the documentation. I missed a point is that dumb-init catch the signals and forwards them to children processes. Looks like problem is still with beanstalkd, so i need write simple wrapper.
My old report: https://github.com/beanstalkd/beanstalkd/issues/527
I think it is exiting? are you sure?
@asottile Yes, it's an old beanstalkd bug.
After
docker-compose stop beanstalk
command container withdumb-init
returns 143 exit code.Dockerfile
docker-compose stop beanstalk
docker-compose exec beanstalk ps aux
PID 1 is correct, dumb-init should catch the signals.