summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-09-04 01:24:14 +0200
committerJohn Crispin <blogic@openwrt.org>2013-09-13 17:35:55 +0200
commit95fbb7eddb70db8e3b4d7d04a71418f5eb1a4a29 (patch)
tree40aae4e699e6ccafa4d21d106b087520e9337152
parent824a4b3da2c0be19ccf54a48dcd4c10677b82c1a (diff)
downloadunitd-95fbb7eddb70db8e3b4d7d04a71418f5eb1a4a29.tar
unitd-95fbb7eddb70db8e3b4d7d04a71418f5eb1a4a29.zip
output the env associated with an instance
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r--instance.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/instance.c b/instance.c
index c25c859..90c167a 100644
--- a/instance.c
+++ b/instance.c
@@ -434,6 +434,15 @@ void instance_dump(struct blob_buf *b, struct service_instance *in, int verbose)
if (in->proc.pending)
blobmsg_add_u32(b, "pid", in->proc.pid);
blobmsg_add_blob(b, in->command);
+
+ if (!avl_is_empty(&in->env.avl)) {
+ struct blobmsg_list_node *var;
+ void *e = blobmsg_open_table(b, "env");
+ blobmsg_list_for_each(&in->env, var)
+ blobmsg_add_string(b, blobmsg_name(var->data), blobmsg_data(var->data));
+ blobmsg_close_table(b, e);
+ }
+
if (verbose && in->trigger)
blobmsg_add_blob(b, in->trigger);
if (!measure_process(in->proc.pid, &pi)) {