summaryrefslogtreecommitdiffstats
path: root/src/systemctl
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-09-30 17:39:19 +0200
committerGitHub <noreply@github.com>2024-09-30 17:39:19 +0200
commita48c1699eb91e5ef54c9e0f9333525ac4974c89b (patch)
tree5874b0546f7c88abbe374c438559820a6c186bef /src/systemctl
parentMerge pull request #34508 from intelfx/work/fix-io-reporting (diff)
parentsystemctl: also show job id in status output (diff)
downloadsystemd-a48c1699eb91e5ef54c9e0f9333525ac4974c89b.tar.xz
systemd-a48c1699eb91e5ef54c9e0f9333525ac4974c89b.zip
Merge pull request #34564 from YHNdnzj/systemctl-status-job-id
systemctl: also show job id in status output
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 bdd438bc2c..0f954b89b3 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));
@@ -2058,6 +2063,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) },