]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: rename special journal field _SYSTEM_CONTEXT= → _RUNTIME_SCOPE=
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2022 15:32:28 +0000 (17:32 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 25 Aug 2022 21:27:26 +0000 (22:27 +0100)
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
src/journal/journald-server.c

index 320b7829923b5711ec3ec4400a4984199df63a2f..68581a21ccc46ddb370722b3bede1ec72ec87ff0 100644 (file)
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><varname>_SYSTEM_CONTEXT=</varname></term>
+        <term><varname>_RUNTIME_SCOPE=</varname></term>
 
-        <listitem><para>A string field that specifies the context in which the message was logged. If
-        <literal>initrd</literal>, the log message was processed while systemd-journald
-        was running inside the initrd. If <literal>main</literal>, the log message was generated after
-        journald switched root to the root filesystem.</para></listitem>
+        <listitem><para>A string field that specifies the runtime scope in which the message was logged. If
+        <literal>initrd</literal>, the log message was processed while the system was running inside the
+        initial RAM disk (initrd). If <literal>system</literal>, the log message was generated after the
+        system switched execution to the host root filesystem.</para></listitem>
       </varlistentry>
     </variablelist>
   </refsect1>
index 49cede6892fed9bc11a11f76bb3b1c4591e0be67..3992d15664d74f89d7cfde9b1ec9751acdf0cd34 100644 (file)
@@ -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))