user47827: 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.

user91194: 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

47827: <p>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 <code>stop_ln</code> (in the <code>startup_regtest</code>, <code>start_ln</code> setup)? Is the plugin opened as a subprocess? Should it handle a particular signal?</p>
<p>This was asked on Telegram.</p>
 91194: <p>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.</p>
<p>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.</p>
<p>This happens with plugins written in Java or Kotlin, with the library <a href="https://github.com/clightning4j/JRPClightning" rel="nofollow noreferrer">clightning4j</a>.</p>
<p>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</p>
<p>This is the procedure that makes the trick <a href="https://github.com/SimonVrouwe/lightning/blob/81325097eddde6dfff911331c09963d5a316a6cc/lightningd/plugin.c#L2090" rel="nofollow noreferrer">https://github.com/SimonVrouwe/lightning/blob/81325097eddde6dfff911331c09963d5a316a6cc/lightningd/plugin.c#L2090</a></p>
