diff --git a/doc/lightning-plugin.7.md b/doc/lightning-plugin.7.md index 7c3032075..dd9b765d4 100644 --- a/doc/lightning-plugin.7.md +++ b/doc/lightning-plugin.7.md @@ -16,9 +16,11 @@ optionally one or two parameters which describes the plugin on which the action has to be taken. The *start* command takes a path as the first parameter and will load -the plugin available from this path. Any additional parameters are -passed to the plugin. It will wait for the plugin to complete the -handshake with `lightningd` for 20 seconds at the most. +the plugin available from this path. The path can be a full path to a +plugin or a relative path to a plugin that is located in or below the +default plugins directory. Any additional parameters are passed to the +plugin. It will wait for the plugin to complete the handshake with +`lightningd` for 20 seconds at the most. The *stop* command takes a plugin name as parameter. It will kill and unload the specified plugin. diff --git a/lightningd/plugin_control.c b/lightningd/plugin_control.c index b583ef1a1..bee3ef56c 100644 --- a/lightningd/plugin_control.c +++ b/lightningd/plugin_control.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include @@ -256,6 +257,9 @@ static struct command_result *json_plugin_control(struct command *cmd, json_get_member(buffer, mod_params, "plugin") - 1, 1); } + if (access(plugin_path, X_OK) != 0) + plugin_path = path_join(cmd, + cmd->ld->plugins->default_dir, plugin_path); if (access(plugin_path, X_OK) == 0) return plugin_dynamic_start(pcmd, plugin_path, buffer, mod_params);