portable: log structured message when attach/detach succeeds

Currently portabled is completely silent (when not using debug level). But
when the system state is changed (ie: a portable is attached or detached)
there are no traces left in the journal. Log at info level when either of
those operations succeed, as they are effectively changing the state of
the system.

Create new MESSAGE_IDs for these logs, and also append PORTABLE_ROOT=
(and PORTABLE_EXTENSION= if any), like the units themselves are
configured to do via LogExtraFields=, so that the same metadata can
be found in the attach/detach messages and in logs from the units
themselves.
This commit is contained in:
Luca Boccassi
2024-01-19 17:03:04 +01:00
committed by Lennart Poettering
parent c03a321ef6
commit a0cca4d1b0
3 changed files with 115 additions and 0 deletions
+20
View File
@@ -748,3 +748,23 @@ Compatibility support for System V services in systemd is deprecated. Please
make sure to update the package in question to provide proper, native systemd
unit files. Contact vendor if necessary. Compatibility support for System V
services is deprecated and will be removed soon.
-- 187c62eb1e7f463bb530394f52cb090f
Subject: A Portable Service has been attached
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://systemd.io/PORTABLE_SERVICES/
A new Portable Service @PORTABLE_ROOT@ (with extensions: @PORTABLE_EXTENSION@) has
been attached to the system and is now available for use. The list of attached
Portable Services can be queried with 'portablectl list'.
-- 76c5c754d628490d8ecba4c9d042112b
Subject: A Portable Service has been detached
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://systemd.io/PORTABLE_SERVICES/
A Portable Service @PORTABLE_ROOT@ (with extensions: @PORTABLE_EXTENSION@) has been
detached from the system and is no longer available for use. The list of attached
Portable Services can be queried with 'portablectl list'.