]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: add some debug logging for sd_notify() messages received by the container...
authorLennart Poettering <lennart@poettering.net>
Tue, 12 Mar 2024 17:51:23 +0000 (18:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 14 Mar 2024 16:24:20 +0000 (17:24 +0100)
src/nspawn/nspawn.c

index c415d3cec1416a7eb53b8e547072da18acac6194..3189c03639535eb92c2bd585204371273accecce 100644 (file)
@@ -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)