1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-02 13:47:27 +03:00
Luca Boccassi e8114a4f86 portable: add PORTABLE_NAME_AND_VERSION= and other metadata to LogsExtraFields=
This is useful to identify log messages with metadata from the images
they run on. Look for ID/VERSION_ID/IMAGE_ID/IMAGE_VERSION/BUILD_ID,
with a SYSEXT_ prefix if we are looking at an extension, and append via
LogExtraFields= as respectively PORTABLE_NAME_AND_VERSION= in case of a
single image. In case of extensions, append as PORTABLE_ROOT_NAME_AND_VERSION=
for the base and one PORTABLE_EXTENSION_AND_VERSION= for each extension.

Example with a base and two extensions, with the unit coming from the
first extension:

[Service]
RootImage=/home/bluca/git/systemd/base.raw
Environment=PORTABLE=app0.raw
BindReadOnlyPaths=/etc/os-release:/run/host/os-release
LogExtraFields=PORTABLE=app0.raw
Environment=PORTABLE_ROOT=base.raw
LogExtraFields=PORTABLE_ROOT=base.raw
LogExtraFields=PORTABLE_ROOT_NAME_AND_VERSION=debian_10

ExtensionImages=/home/bluca/git/systemd/app0.raw
LogExtraFields=PORTABLE_EXTENSION=app0.raw
LogExtraFields=PORTABLE_EXTENSION_NAME_AND_VERSION=app_0

ExtensionImages=/home/bluca/git/systemd/app1.raw
LogExtraFields=PORTABLE_EXTENSION=app1.raw
LogExtraFields=PORTABLE_EXTENSION_NAME_AND_VERSION=app_1
2023-03-28 12:14:21 +01:00
..
2023-01-29 20:26:28 +09:00
2022-05-17 23:00:18 +02:00
2019-12-11 17:04:20 +01:00
2022-01-12 16:05:59 +01:00
2023-01-23 22:52:34 +00:00
2023-01-23 22:52:34 +00:00
2023-01-23 22:52:34 +00:00
2023-01-23 22:52:34 +00:00
2023-01-23 22:52:34 +00:00
2019-12-11 17:04:20 +01:00
2022-05-18 20:34:10 +02:00
2022-05-18 20:34:10 +02:00
2022-06-28 16:05:31 +02:00
2023-01-23 22:52:34 +00:00