From: Felix Fietkau Date: Fri, 31 May 2013 15:14:50 +0000 (+0200) Subject: restart stopped instances on update X-Git-Url: http://git.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=14afa266e26e878ccdb828c9582e402223c41fcf;ds=sidebyside restart stopped instances on update Signed-off-by: Felix Fietkau --- diff --git a/instance.c b/instance.c index 1c2d8ba..a1459b7 100644 --- a/instance.c +++ b/instance.c @@ -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; }