From 19f12d01120be0a724797ee2f3ff38419affa191 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 26 Jan 2021 16:23:04 +0100 Subject: [PATCH] Prefer resolvectl over systemd-resolve The latter is a deprecated compat symlink. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979264 Signed-off-by: Michael Biebl --- sos/report/plugins/systemd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sos/report/plugins/systemd.py b/sos/report/plugins/systemd.py index ebbebe38fa..7df1b69dea 100644 --- a/sos/report/plugins/systemd.py +++ b/sos/report/plugins/systemd.py @@ -21,6 +21,8 @@ class Systemd(Plugin, IndependentPlugin): packages = ('systemd',) files = ('/run/systemd/system',) + resolvectl = 'resolvectl' if self.is_executable('resolvectl') else 'systemd-resolve' + def setup(self): self.add_cmd_output([ "systemctl status --all", @@ -47,11 +49,11 @@ def setup(self): "timedatectl" ]) - # systemd-resolve command starts systemd-resolved service if that + # resolvectl command starts systemd-resolved service if that # is not running, so gate the commands by this predicate self.add_cmd_output([ - "systemd-resolve --status", - "systemd-resolve --statistics", + "%s status" % resolvectl, + "%s statistics" % resolvectl, ], pred=SoSPredicate(self, services=["systemd-resolved"])) self.add_cmd_output("systemd-analyze plot",