Closed namedgraph closed 5 years ago
Can you share your entrypoint code?
You probably want something like this instead to make sure the bash process doesn't stick around to receive (and essentially blackhole) the signals Tini forwards:
exec java -jar xxx.jar
Smth like this:
java -jar $@" > "$json_xml" # can't use exec because the container will quit after script is done
xmllint --schema ./xsd/json2xml.xsd --noout "$json_xml" >&2
rm "$json_xml"
I tried exec
, the problem is that I have some cleanup code after the Java process, but exec
exits the whole script no matter success or error, and that code never gets executed.
Thanks. That's not going to work right now with Tini, but there is a fork that allows for post-processing commands, have a look at that: https://github.com/krallin/tini/pull/129
I haven't had time to figure out whether this makes sense to incorporate in Tini and to do so, so you'll have to build this yourself, but I think that's what you need here.
Alternatively, you might want to try passing -g
to Tini to signal the entire process group (i.e. bash + java) :smile:.
I went with this kind of solution: https://stackoverflow.com/a/29890106/1003113
Hi,
I made my entrypoint such:
Now the entrypoint invokes a Java process:
java
process cannot be killed by killing the container using Ctrl+C, and addingtini
toENTRYPOINT
does not make any difference. Can tini help in this situation or do I need another solution?Help is appreciated.