From abd6faae80fa87ecc24a000447b86fc32499809d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Aug 2022 17:32:28 +0200 Subject: [PATCH] =?utf8?q?journal:=20rename=20special=20journal=20field=20?= =?utf8?q?=5FSYSTEM=5FCONTEXT=3D=20=E2=86=92=20=5FRUNTIME=5FSCOPE=3D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously the field "_SYSTEM_CONTEXT" knew he values "initrd" + "main". Let's change this to "_RUNTIME_SCOPE" and "initrd" + "system". Why? The sysext logic has a very similar concept of "scopes", declaring whether a sysext image is intended for the initrd or the main system. Let's thus use the same naming for both. sysext's extension-release files hence know SYSEXT_SCOPE=initrd|system, and the journal messages know _RUNTIME_SCOPE=initrd|system, which makes this reasonably systematic. Follow-up for: cae8edd93ca2ef90c41cb9b6322b6908d12947b5 (This is not an API break, since no version with this commit has ever been released.) --- man/systemd.journal-fields.xml | 10 +++++----- src/journal/journald-server.c | 6 +----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/man/systemd.journal-fields.xml b/man/systemd.journal-fields.xml index 320b7829923..68581a21ccc 100644 --- a/man/systemd.journal-fields.xml +++ b/man/systemd.journal-fields.xml @@ -399,12 +399,12 @@ - _SYSTEM_CONTEXT= + _RUNTIME_SCOPE= - A string field that specifies the context in which the message was logged. If - initrd, the log message was processed while systemd-journald - was running inside the initrd. If main, the log message was generated after - journald switched root to the root filesystem. + A string field that specifies the runtime scope in which the message was logged. If + initrd, the log message was processed while the system was running inside the + initial RAM disk (initrd). If system, the log message was generated after the + system switched execution to the host root filesystem. diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 49cede6892f..3992d15664d 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -1035,11 +1035,7 @@ static void dispatch_message_real( if (!isempty(s->namespace_field)) iovec[n++] = IOVEC_MAKE_STRING(s->namespace_field); - if (in_initrd()) - iovec[n++] = IOVEC_MAKE_STRING("_SYSTEM_CONTEXT=initrd"); - else - iovec[n++] = IOVEC_MAKE_STRING("_SYSTEM_CONTEXT=main"); - + iovec[n++] = in_initrd() ? IOVEC_MAKE_STRING("_RUNTIME_SCOPE=initrd") : IOVEC_MAKE_STRING("_RUNTIME_SCOPE=system"); assert(n <= m); if (s->split_mode == SPLIT_UID && c && uid_is_valid(c->uid)) -- 2.47.3