From: Lennart Poettering Date: Thu, 18 Apr 2024 09:18:35 +0000 (+0200) Subject: systemctl: show invocation ID in unit status output X-Git-Tag: v256-rc1~133^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F32330%2Fhead;p=thirdparty%2Fsystemd.git systemctl: show invocation ID in unit status output I think we should put more emphasis on the invocation ID as a handle for a specific runtime cycle of a unit. Let's start with actually showing it to users. See: #16035 --- diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 7926bfbecaf..aee839de4ca 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -196,6 +196,8 @@ typedef struct UnitStatusInfo { uint64_t runtime_max_sec; + sd_id128_t invocation_id; + bool need_daemon_reload; bool transient; @@ -468,6 +470,9 @@ static void print_status_info( } else printf("\n"); + if (!sd_id128_is_null(i->invocation_id)) + printf(" Invocation: " SD_ID128_FORMAT_STR "\n", SD_ID128_FORMAT_VAL(i->invocation_id)); + STRV_FOREACH(t, i->triggered_by) { UnitActiveState state = _UNIT_ACTIVE_STATE_INVALID; @@ -2031,8 +2036,9 @@ static int show_one( { "InactiveExitTimestampMonotonic", "t", NULL, offsetof(UnitStatusInfo, inactive_exit_timestamp_monotonic) }, { "ActiveEnterTimestamp", "t", NULL, offsetof(UnitStatusInfo, active_enter_timestamp) }, { "ActiveExitTimestamp", "t", NULL, offsetof(UnitStatusInfo, active_exit_timestamp) }, - { "RuntimeMaxUSec", "t", NULL, offsetof(UnitStatusInfo, runtime_max_sec) }, { "InactiveEnterTimestamp", "t", NULL, offsetof(UnitStatusInfo, inactive_enter_timestamp) }, + { "RuntimeMaxUSec", "t", NULL, offsetof(UnitStatusInfo, runtime_max_sec) }, + { "InvocationID", "s", bus_map_id128, offsetof(UnitStatusInfo, invocation_id) }, { "NeedDaemonReload", "b", NULL, offsetof(UnitStatusInfo, need_daemon_reload) }, { "Transient", "b", NULL, offsetof(UnitStatusInfo, transient) }, { "ExecMainPID", "u", NULL, offsetof(UnitStatusInfo, main_pid) },