[LEDE-DEV] [PATCH] instance: properly compare and reload respawn config

Karl Palsson karlp at etactica.com
Mon Sep 25 05:28:16 PDT 2017


respawn configuration variables were not checked for changes, and were
not copied to new instances.

Signed-off-by: Karl Palsson <karlp at etactica.com>
---
 service/instance.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/service/instance.c b/service/instance.c
index a968a0b..d12c580 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -629,6 +629,13 @@ instance_config_changed(struct service_instance *in, struct service_instance *in
 	if (!in->pidfile && in_new->pidfile)
 		return true;
 
+	if (in->respawn_retry != in_new->respawn_retry)
+		return true;
+	if (in->respawn_threshold != in_new->respawn_threshold)
+		return true;
+	if (in->respawn_timeout != in_new->respawn_timeout)
+		return true;
+
 	if (!blobmsg_list_equal(&in->limits, &in_new->limits))
 		return true;
 
@@ -949,6 +956,9 @@ instance_config_move(struct service_instance *in, struct service_instance *in_sr
 	in->trigger = in_src->trigger;
 	in->command = in_src->command;
 	in->pidfile = in_src->pidfile;
+	in->respawn_retry = in_src->respawn_retry;
+	in->respawn_threshold = in_src->respawn_threshold;
+	in->respawn_timeout = in_src->respawn_timeout;
 	in->name = in_src->name;
 	in->node.avl.key = in_src->node.avl.key;
 
-- 
2.4.11




More information about the Lede-dev mailing list