mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
lightningd/plugin_control: add a 'plugin' command
This adds a new pair of files : lightningd/plugin_control, along with a new RPC command : 'plugin'. This command can be used to manage plugins without restarting lightningd: lightning-cli plugin start helloworld.py lightning-cli plugin stop helloworld.py
This commit is contained in:
@@ -121,7 +121,7 @@ void PRINTF_FMT(2,3) plugin_kill(struct plugin *plugin, char *fmt, ...)
|
||||
msg = tal_vfmt(plugin, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
log_broken(plugin->log, "Killing plugin: %s", msg);
|
||||
log_info(plugin->log, "Killing plugin: %s", msg);
|
||||
plugin->stop = true;
|
||||
io_wake(plugin);
|
||||
kill(plugin->pid, SIGKILL);
|
||||
@@ -813,6 +813,12 @@ static void plugin_manifest_cb(const char *buffer,
|
||||
plugin_kill(
|
||||
plugin,
|
||||
"Failed to register options, methods, hooks, or subscriptions.");
|
||||
|
||||
/* If all plugins have replied to getmanifest and this is not
|
||||
* the startup init, configure them */
|
||||
if (!plugin->plugins->startup && plugin->plugins->pending_manifests == 0)
|
||||
plugins_config(plugin->plugins);
|
||||
|
||||
/* Reset timer, it'd kill us otherwise. */
|
||||
tal_free(plugin->timeout_timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user