aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>2018-09-13 16:01:39 +0900
committerBryn M. Reeves <bmr@redhat.com>2019-03-18 11:46:10 +0000
commit9e05c15212a257189f47621f416f50ef86833d81 (patch)
tree803a16625b01f369a087061f9971d94c01570ee8
parent4e2ddbd5a642687796b7c7fe6233079a80bc58dd (diff)
downloadsos-9e05c15212a257189f47621f416f50ef86833d81.tar.gz
[systemd] Add 'systemctl list-jobs' to systemd plugin
This patch adds the output of 'systemctl list-jobs', providing a list of jobs that are in progress. This is sometimes useful when we try to analyze troubles such as some units are unexpectedly not started/stopped. For example, consider there is the inquiry from some customer that multi-user.target on our system is configured as default.target but is still inactive after system boot, why? # LANG=C systemctl get-default multi-user.target # LANG=C systemctl status multi-user.target * multi-user.target - Multi-User System Loaded: loaded (/usr/lib/systemd/system/multi-user.target; \ enabled; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd.special(7) In such case, systemctl list-jobs gives us the clear suggestion that there is a still running start job for foobar.service and multi-user.target and the other units are waiting for it to finish. # LANG=C systemctl --no-pager list-jobs JOB UNIT TYPE STATE 112 multi-user.target start waiting 226 systemd-update-utmp-runlevel.service start waiting 258 foobar.service start running 236 systemd-readahead-done.timer start waiting 4 jobs listed. Resolves: #1427 Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/systemd.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/sos/plugins/systemd.py b/sos/plugins/systemd.py
index e417a182..e251747f 100644
--- a/sos/plugins/systemd.py
+++ b/sos/plugins/systemd.py
@@ -29,6 +29,7 @@ class Systemd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"systemctl status --all",
"systemctl show --all",
"systemctl show *service --all",
+ "systemctl list-jobs",
# It is possible to do systemctl show with target, slice,
# device, socket, scope, and mount too but service and
# status --all mostly seems to cover the others.