Skip to content

Commit 1e68700

Browse files
committed
docker: Adjust LN datadir paths
And add a `sleep` before attempting to connect, which now appears to be necessary. Refs #77
1 parent 469227f commit 1e68700

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

bin/docker-entrypoint.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,28 @@ else
6666
lightningd "${lnopt[@]}" $(echo "$RPC_OPT" | sed -r 's/(^| )-/\1--bitcoin-/g') > /dev/null &
6767
fi
6868

69-
if [ ! -S /etc/lightning/lightning-rpc ]; then
69+
LN_NET_PATH=$LN_PATH/$NETWORK
70+
71+
if [ ! -S $LN_NET_PATH/lightning-rpc ]; then
7072
echo -n "waiting for RPC unix socket... "
71-
sed --quiet '/^lightning-rpc$/ q' <(inotifywait -e create,moved_to --format '%f' -qm $LN_PATH)
73+
sed --quiet '/^lightning-rpc$/ q' <(inotifywait -e create,moved_to --format '%f' -qm $LN_NET_PATH)
7274
fi
75+
sleep 0.5
7376

7477
if command -v lightning-cli > /dev/null; then
75-
lightning-cli --rpc-file=$LN_PATH/lightning-rpc getinfo > /dev/null
78+
lightning-cli --rpc-file=$LN_NET_PATH/lightning-rpc getinfo > /dev/null
7679
echo -n "c-lightning RPC ready."
7780
fi
7881

7982
echo -e "\nStarting Lightning Charge"
8083

8184
if [ -z "$STANDALONE" ]; then
8285
# when not in standalone mode, run spark-wallet as an additional background job
83-
charged -d /data/charge.db -l $LN_PATH -i 0.0.0.0 "$@" $CHARGED_OPTS &
86+
charged -d /data/charge.db -l $LN_NET_PATH -i 0.0.0.0 "$@" $CHARGED_OPTS &
8487

8588
# shutdown the entire process when any of the background jobs exits (even if successfully)
8689
wait -n
8790
kill -TERM $$
8891
else
89-
exec charged -d /data/charge.db -l $LN_PATH -i 0.0.0.0 "$@" $CHARGED_OPTS
92+
exec charged -d /data/charge.db -l $LN_NET_PATH -i 0.0.0.0 "$@" $CHARGED_OPTS
9093
fi

0 commit comments

Comments
 (0)