instance: properly compare and reload respawn config
authorKarl Palsson <karlp@etactica.com>
Mon, 25 Sep 2017 12:28:16 +0000 (12:28 +0000)
committerJohn Crispin <john@phrozen.org>
Thu, 28 Sep 2017 06:27:25 +0000 (08:27 +0200)
respawn configuration variables were not checked for changes, and were
not copied to new instances.

Signed-off-by: Karl Palsson <karlp@etactica.com>
service/instance.c

index 77036862227e55ad63cf0abe537d94604ce0e020..b7cb523f402ea240cafd6dcc1aacc68c8647a374 100644 (file)
@@ -626,6 +626,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;
 
@@ -939,6 +946,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->trace = in_src->trace;
        in->node.avl.key = in_src->node.avl.key;