MCPcopy Create free account
hub / github.com/ElementsProject/lightning / plugin_kill

Function plugin_kill

lightningd/plugin.c:439–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439void plugin_kill(struct plugin *plugin, enum log_level loglevel,
440 const char *fmt, ...)
441{
442 va_list ap;
443 const char *msg;
444
445 va_start(ap, fmt);
446 msg = tal_vfmt(tmpctx, fmt, ap);
447 va_end(ap);
448
449 log_(plugin->log, loglevel,
450 NULL, loglevel >= LOG_UNUSUAL,
451 "Killing plugin: %s", msg);
452 /* Unless, maybe, plugin was *really* important? */
453 assert(plugin->pid != -1);
454 kill(plugin->pid, SIGKILL);
455 if (plugin->start_cmd) {
456 plugin_cmd_killed(plugin->start_cmd, plugin, msg);
457 plugin->start_cmd = NULL;
458 }
459
460 tal_free(plugin);
461}
462
463/**
464 * Send a JSON-RPC message (request or notification) to the plugin.

Callers 8

check_plugins_manifestsFunction · 0.85
plugin_registerFunction · 0.85
plugin_read_jsonFunction · 0.85
plugin_conn_finishFunction · 0.85
plugin_manifest_timeoutFunction · 0.85
plugin_manifest_cbFunction · 0.85
plugin_config_cbFunction · 0.85
plugin_stopFunction · 0.85

Calls 3

plugin_cmd_killedFunction · 0.85
tal_freeFunction · 0.85
log_Function · 0.70

Tested by

no test coverage detected