lightningd: don't abort on incorrect versions, but try to re-exec.

You still shouldn't do this (you could get some transient failures),
but at least you have a decent chance if you reinstall over a running
daemon, instead of getting confusing internal errors if message
formats have changed.

Changelog-Added: lightningd: we now try to restart if subdaemons are upgraded underneath us.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: #4346
This commit is contained in:
Rusty Russell
2021-04-16 14:01:24 +09:30
parent 8714bf903c
commit 32d650f9df
6 changed files with 87 additions and 4 deletions

11
tests/plugins/badopeningd.sh Executable file
View File

@@ -0,0 +1,11 @@
#! /bin/sh
# If this file exists, we send that message back, then sleep.
if [ $# = 0 ] && [ -f openingd-version ]; then
# lightningd expects us to write to stdin!
cat openingd-version >&0
sleep 10
exit 0
fi
exec "$(cat openingd-real)" "$@"