Is it normal if a plugin that I've written doesn't shut down (ie the Python process is still running) after I've called stop_ln (in the startup_regtest, start_ln setup)? Is the plugin opened as a subprocess? Should it handle a particular signal?

This was asked on Telegram.

2 Answers 2


In c-lightning, we give time to the plugin to shutdown, and after some time (30 seconds) if the plugin doesn't answer to shutdown we kill it.

However, some type of plugin can keep going because they can be run by a bash script or something else, and c-lighting kills only the bash script process and not the real project.

This happens with plugins written in Java or Kotlin, with the library clightning4j.

In conclusion, some of these plugins make a fake closing, in particular, if the plugin answer to the shutdown notification, c-lighting could not kill it, but assume that the plugin kills itself (with simple an exit(0)), this can be a use case where the plugin is badly written, but for sure have an example can help to debug the use case

This is the procedure that makes the trick https://github.com/SimonVrouwe/lightning/blob/81325097eddde6dfff911331c09963d5a316a6cc/lightningd/plugin.c#L2090


This is a draft answer from answers on Telegram. Alternative more detailed answers are welcome.

Plugins are subprocesses that are started by the main lightningd daemon. They work in cooperation with lightningd.

The plugin should stop when stdin is closed. The default behavior is that the plugin closes with normal signals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.