From 23059284ec4fa885771eb9a77f722be6b67dc0c1 Mon Sep 17 00:00:00 2001 From: Mateusz Majewski Date: Fri, 2 Sep 2022 11:12:00 +0200 Subject: [PATCH] Hack in a graceful shutdown of the daemon in the zero-copy backend Change-Id: Ia01d41469b14895c0de5435a30bb290610ba9c47 --- src/logger/logger.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/logger/logger.c b/src/logger/logger.c index 8d37267..29163c1 100644 --- a/src/logger/logger.c +++ b/src/logger/logger.c @@ -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; -- 2.7.4