lnd postStart: poll for REST service availability

Improves service startup time compared to just sleeping
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:41 +01:00
parent 795c51dc01
commit 3e86637327
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -98,7 +98,11 @@ in {
postStart = ''
umask 377
sleep 5
attempts=50
while ! { exec 3>/dev/tcp/127.0.0.1/8080 && exec 3>&-; } &>/dev/null; do
((attempts-- == 0)) && { echo "lnd REST service unreachable"; exit 1; }
sleep 0.1
done
if [[ ! -f /secrets/lnd-seed-mnemonic ]]; then
echo Creating lnd seed