From e6ceea090a18ed7765afcafc07d18a86dfdaa1da Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Mar 2024 18:51:23 +0100 Subject: [PATCH] nspawn: add some debug logging for sd_notify() messages received by the container manager --- src/nspawn/nspawn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index c415d3cec14..3189c036395 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -4408,6 +4408,17 @@ static int nspawn_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t r if (!tags) return log_oom(); + if (DEBUG_LOGGING) { + _cleanup_free_ char *joined = strv_join(tags, " "); + + if (joined) { + _cleanup_free_ char *j = cescape(joined); + free_and_replace(joined, j); + } + + log_debug("Got sd_notify() message: %s", strnull(joined)); + } + if (strv_contains(tags, "READY=1")) { r = sd_notify(false, "READY=1\n"); if (r < 0) -- 2.47.3