Merge pull request #32330 from poettering/status-invocation

systemctl: show invocation ID in unit status output
This commit is contained in:
Lennart Poettering 2024-04-18 15:47:20 +02:00 committed by GitHub
commit 51286123da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) },