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
@@ -121,7 +121,18 @@ else
set -- $MAX_OLD_SPACE_SIZE "$@"
set -- $MAX_OLD_SPACE_SIZE "$@"
fi
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
# Start duniter
 
# Launch in background and wait
 
# This way we can catch SIGTERM
echo Starting duniter with:
echo Starting duniter with:
echo /usr/bin/duniter "$@"
echo /usr/bin/duniter "$@"
exec /usr/bin/duniter "$@"
/usr/bin/duniter "$@" &
 
wait %1
Loading