diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-05-31 17:14:50 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-05-31 17:27:40 +0200 |
commit | 14afa266e26e878ccdb828c9582e402223c41fcf (patch) | |
tree | d4e50e0190a1ef8b0eaefbb8df26797c4bec75bb | |
parent | ef86e35932ffafb43644169ea33b849f58873256 (diff) | |
download | unitd-14afa266e26e878ccdb828c9582e402223c41fcf.tar unitd-14afa266e26e878ccdb828c9582e402223c41fcf.zip |
restart stopped instances on update
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | instance.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -322,13 +322,20 @@ bool instance_update(struct service_instance *in, struct service_instance *in_new) { bool changed = instance_config_changed(in, in_new); + bool running = in->proc.pending; - if (!changed) + if (!changed && running) return false; - in->restart = true; - instance_stop(in, true); - instance_config_move(in, in_new); + if (!running) { + if (changed) + instance_config_move(in, in_new); + instance_start(in); + } else { + in->restart = true; + instance_stop(in, true); + instance_config_move(in, in_new); + } return true; } |