service: do not emit any service events before the ubus connection is up
authorFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jun 2014 14:53:29 +0000 (16:53 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jun 2014 14:53:29 +0000 (16:53 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
service/service.c

index 642692963a2dfd3e949740f89ebdfbfedbc8b8ac..74feded39ed292e651f33941cdc6f553cba79fd0 100644 (file)
@@ -453,6 +453,9 @@ service_start_early(char *name, char *cmdline)
 
 void service_event(const char *type, const char *service, const char *instance)
 {
+       if (!ctx)
+               return;
+
        blob_buf_init(&b, 0);
        blobmsg_add_string(&b, "service", service);
        if (instance)