Skip to content

Commit 02e06fc

Browse files
NicolasDorierdaywalker90
authored andcommitted
Fix: SIGINT was ignored by the cln docker container
Changelog-Fixed: Fix: SIGINT was ignored by the cln docker container
1 parent 4323207 commit 02e06fc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tools/docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ networkdatadir="${LIGHTNINGD_DATA}/${LIGHTNINGD_NETWORK}"
66

77
set -m
88
lightningd --network="${LIGHTNINGD_NETWORK}" "$@" &
9+
LIGHTNINGD_PID=$!
10+
trap 'kill -TERM "$LIGHTNINGD_PID" 2>/dev/null' TERM INT
911

1012
echo "Core-Lightning starting"
1113
while read -r i; do if [ "$i" = "lightning-rpc" ]; then break; fi; done \
@@ -24,4 +26,7 @@ if [ -d "$LIGHTNINGD_DATA"/lightning-poststart.d ]; then
2426
done
2527
fi
2628

27-
fg %-
29+
wait "$LIGHTNINGD_PID"
30+
trap - TERM INT
31+
wait "$LIGHTNINGD_PID"
32+
exit $?

0 commit comments

Comments
 (0)