From 324c1cc004cb7a8f9b20caa0b94de9f8bb68b307 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 10 Dec 2018 15:36:16 +0100 Subject: [PATCH] plugin: Set LIGHTNINGD_PLUGIN env var inform plugins It might be useful to take special precautions inside a plugin when being run as a plugin (and not as a standalone executable). This env var is just set so plugins can differentiate correctly. I don't unset the variable since it shouldn't have any effect on `lightningd` itself. Signed-off-by: Christian Decker --- lightningd/plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index e41b32af0..942609dd1 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -899,6 +899,7 @@ void plugins_init(struct plugins *plugins, const char *dev_plugin_debug) plugins->pending_manifests = 0; uintmap_init(&plugins->pending_requests); + setenv("LIGHTNINGD_PLUGIN", "1", 1); /* Spawn the plugin processes before entering the io_loop */ list_for_each(&plugins->plugins, p, list) { bool debug;