Closed ahmetb closed 5 years ago
I think this is expected, as tini acts as an init process. If any init process were to reap a grand-child zombie, the init's child would no longer have the possibility to query the status of the grand-child (i.e. it's child). But the child may be interested in the grandchild's exit status.
Yeah, @corneliusweig is entirely correct here, this is indeed expected. Processes will only be re-parented to Tini once their parent dies.
Thanks.
Inside a docker container I'm running
tini-static
v0.18.0 and it runs a Go program.This go program executes a
/bin/sh
,-c
,sleep 999999 && sleep 99999
in the background (doesn'twait()
for it) but it just gets its pid:You'll note that I have
Setpgid: true
as an exec option above, which creates a new "process group" that has the same ID as this new process's PID.So when the Go program starts, the process tree looks like this:
Now, I hit an endpoint that kills this
sh
process with SIGKILL. To do that I'm actually using kill with negative value of thesh
's PID (-14). In go this looks like:and it's equivalent to GNU
kill -KILL -14
command.Once
kill
is issued, I observe three things:sh
process is now a zombie (Z) and is not reparented totini
but still underserver
sleep
(subprocess of "sh") is now gone:Is this expected?