From: Lennart Poettering Date: Tue, 12 Mar 2024 17:51:23 +0000 (+0100) Subject: nspawn: add some debug logging for sd_notify() messages received by the container... X-Git-Tag: v256-rc1~521^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6ceea090a18ed7765afcafc07d18a86dfdaa1da;p=thirdparty%2Fsystemd.git nspawn: add some debug logging for sd_notify() messages received by the container manager --- 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)