chiark / gitweb /
journald: log the slice of a process along with each message in _SYSTEMD_SLICE=
[elogind.git] / src / journal / journald-server.c
index ba211b3724f99fe8518fe430472efc60419ea1c9..709fa8b7d09921eadc246775d13461c963681729 100644 (file)
@@ -638,6 +638,12 @@ static void dispatch_message_real(
                                 IOVEC_SET_STRING(iovec[n++], x);
                         }
 
+                        if (cg_path_get_slice(c, &t) >= 0) {
+                                x = strappenda("_SYSTEMD_SLICE=", t);
+                                free(t);
+                                IOVEC_SET_STRING(iovec[n++], x);
+                        }
+
                         free(c);
                 }