the automatic service restart should not happen during sysupgrade
authorJohn Crispin <blogic@openwrt.org>
Fri, 8 Nov 2013 21:25:20 +0000 (22:25 +0100)
committerJohn Crispin <blogic@openwrt.org>
Fri, 8 Nov 2013 21:40:03 +0000 (22:40 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
instance.c
procd.h
system.c

index 7895a04cc7b03cb74ff3749112bd75c5327e83b1..05b0f991499b245128fc2a7b851ee54ad01a56a1 100644 (file)
@@ -149,6 +149,9 @@ instance_exit(struct uloop_process *p, int ret)
        runtime = tp.tv_sec - in->start.tv_sec;
 
        DEBUG(1, "Instance %s::%s exit with error code %d after %ld seconds\n", in->srv->name, in->name, ret, runtime);
+       if (upgrade_running)
+               return;
+
        uloop_timeout_cancel(&in->timeout);
        if (in->halt) {
                /* no action */
diff --git a/procd.h b/procd.h
index 34cc9a1beb3e6570eb5aa356fa525603053e6833..a0c7a996f6e19171fbf59137f67c19cb3aefdfee 100644 (file)
--- a/procd.h
+++ b/procd.h
@@ -42,6 +42,7 @@
        } while (0)
 
 extern char *ubus_socket;
+extern int upgrade_running;
 
 extern unsigned int debug;
 void debug_init(void);
index 0b3c46629c567f2118fddcffae550bae91d0acb1..54a84b468f50b10f2221a96d4d37288ae3d18c39 100644 (file)
--- a/system.c
+++ b/system.c
@@ -29,6 +29,8 @@
 
 static struct blob_buf b;
 
+int upgrade_running = 0;
+
 static int system_board(struct ubus_context *ctx, struct ubus_object *obj,
                  struct ubus_request_data *req, const char *method,
                  struct blob_attr *msg)
@@ -191,6 +193,8 @@ static int system_upgrade(struct ubus_context *ctx, struct ubus_object *obj,
        log_shutdown();
        hotplug_shutdown();
 
+       upgrade_running = 1;
+
        return 0;
 }