From 25bbaf8c359aa76e10371e865355adc11fd7890c Mon Sep 17 00:00:00 2001 From: Snogard Date: Sun, 9 Jun 2024 18:29:40 +0200 Subject: [PATCH] catching sigterm for foundry --- build/foundry/src/entrypoint.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/foundry/src/entrypoint.sh b/build/foundry/src/entrypoint.sh index d4ae62f..bf62fb6 100755 --- a/build/foundry/src/entrypoint.sh +++ b/build/foundry/src/entrypoint.sh @@ -1,5 +1,14 @@ #!/bin/sh +_sig_term() { + echo "Chaught SIGTERM signal!" + kill -TERM "$node_pid" 2>/dev/null +} + + + +trap _sig_term TERM + optionsPath=/home/foundry/data/Config/options.json if [ -f "${optionsPath}" ]; then @@ -13,6 +22,9 @@ echo "${optionsPath} not found the settings will be applied on next restart" fi -node "$@" +node "$@" & +node_pid=$! + +wait $node_pid exit 0 \ No newline at end of file