summaryrefslogtreecommitdiffstats
path: root/src/systemctl
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-09-26 17:36:24 +0200
committerMike Yuan <me@yhndnzj.com>2024-09-26 17:59:00 +0200
commitb1ec48369caa99ab9f9581355587a4f256f0a43f (patch)
tree9057bef6e1d653d9767a3a633d827dda9efd4cbf /src/systemctl
parentshared/bus-map-properties: move bus_map_job_id() from wait-for-units (diff)
downloadsystemd-b1ec48369caa99ab9f9581355587a4f256f0a43f.tar.xz
systemd-b1ec48369caa99ab9f9581355587a4f256f0a43f.zip
systemctl: also show job id in status output
Prompted by one ASG talk ;)
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl-show.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c
index 2f39bc2b12..60db148f4b 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;
+ uint32_t job_id;
+
sd_id128_t invocation_id;
bool need_daemon_reload;
@@ -472,6 +474,9 @@ static void print_status_info(
} else
printf("\n");
+ if (i->job_id != 0)
+ printf(" Job: %" PRIu32 "\n", i->job_id);
+
if (!sd_id128_is_null(i->invocation_id))
printf(" Invocation: " SD_ID128_FORMAT_STR "\n", SD_ID128_FORMAT_VAL(i->invocation_id));
@@ -2035,6 +2040,7 @@ static int show_one(
{ "ActiveState", "s", NULL, offsetof(UnitStatusInfo, active_state) },
{ "FreezerState", "s", NULL, offsetof(UnitStatusInfo, freezer_state) },
{ "SubState", "s", NULL, offsetof(UnitStatusInfo, sub_state) },
+ { "Job", "(uo)", bus_map_job_id, offsetof(UnitStatusInfo, job_id) },
{ "UnitFileState", "s", NULL, offsetof(UnitStatusInfo, unit_file_state) },
{ "UnitFilePreset", "s", NULL, offsetof(UnitStatusInfo, unit_file_preset) },
{ "Description", "s", NULL, offsetof(UnitStatusInfo, description) },