lightning-tools
lightning-tools copied to clipboard
Demonstrate custom shutdown behaviour
I just wanted to know if my proposed solution in c-lightning #4883 for injecting custom shutdown behavior could work. Its the second best thing (see below).
Custom shutdown behavior can be arranged with a plugin that registers a new rpc method
shutdown_clean
(or such) which kind of overloads the stop RPC command. That plugin registers
hooks and has handlers for its custom shutdown behavior, or better: it spins-up other plugins
that register these hooks in-time when shutdown_clean is called.
TODO:
Would be nice if be could overload the real stop
command with rpc_command hook.
Tried that, but it hangs the hook handling method in the plugin when that method makes
another rpc call which recursively calls rpc_command hook again (and waits for its
result).
Thanks a lot for the PR! Yes, the gracefulshutdown plugin does not work properly and needs some love. I need to read and page back in a lot of context around this, so I will take a closer look at this in a few days.