Skip to content
Snippets Groups Projects

docker: move sigterm handling up to the entrypoint

Open pini requested to merge pini-docker into dev
2 files
+ 13
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -121,7 +121,18 @@ else
set -- $MAX_OLD_SPACE_SIZE "$@"
fi
# Terminate gracefully on SIGTERM by propagating it to the 'node' process
sigterm () {
echo "Received SIGTERM. Terminating..." >&2
pkill node
wait %1
}
trap 'sigterm' TERM
# Start duniter
# Launch in background and wait
# This way we can catch SIGTERM
echo Starting duniter with:
echo /usr/bin/duniter "$@"
exec /usr/bin/duniter "$@"
/usr/bin/duniter "$@" &
wait %1
Loading