Skip to content
Snippets Groups Projects
Commit ace29123 authored by Gilles Filippini's avatar Gilles Filippini
Browse files

docker: move sigterm handling up to the entrypoint

Having it into the duniter.sh script prevents using duniter subcommands
such as `duniter wizard key` which are then launched in the background.

Moving it into the entrypoint makes the subcommands available again.
parent e87912d8
No related branches found
No related tags found
1 merge request!1437docker: move sigterm handling up to the entrypoint
Pipeline #32547 passed
...@@ -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
#!/bin/sh #!/bin/sh
# Terminate gracefully on SIGTERM by propagating it to the 'node' process
sigterm () {
echo "Received SIGTERM. Terminating..." >&2
pkill node
wait %1
}
trap 'sigterm' TERM
# Main # Main
cd /duniter cd /duniter
if [ "$1" != --home ]; then if [ "$1" != --home ]; then
set -- --home /var/lib/duniter "$@" set -- --home /var/lib/duniter "$@"
fi fi
# Launch in background and wait exec bin/duniter "$@"
# This way we can catch SIGTERM
bin/duniter "$@" &
wait %1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment