Hack in a graceful shutdown of the daemon in the zero-copy backend 13/280713/2
authorMateusz Majewski <m.majewski2@samsung.com>
Fri, 2 Sep 2022 09:12:00 +0000 (11:12 +0200)
committerMichal Bloch <m.bloch@partner.samsung.com>
Mon, 5 Sep 2022 11:34:02 +0000 (11:34 +0000)
Change-Id: Ia01d41469b14895c0de5435a30bb290610ba9c47

src/logger/logger.c

index 8d37267..29163c1 100644 (file)
@@ -1140,7 +1140,12 @@ int prepare_config_data(struct logger_config_data *data)
                                        NELEMS(g_backend.logger_devices[buf_id]) - 1);
                }
        } else if (!strcmp(backend, "zero-copy")) {
-               ret = -ENOTSUP;
+               /* HACK: This essentially skips reading the most important configuration fields
+                * (buffer reading and persistent logs) while ensuring the variables are initialized.
+                * This will result in daemon quitting. Hopefully we will either reenable some of these
+                * in the future or at least make it exit more gracefully (TODO), but for now this is ok. */
+               g_backend.use_logger_by_default = false;
+               data->logfile_configs = NULL;
                goto end;
        } else {
                ret = -ENOENT;