Skip to content

Commit

Permalink
Prefer resolvectl over systemd-resolve
Browse files Browse the repository at this point in the history
The latter is a deprecated compat symlink.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979264

Signed-off-by: Michael Biebl <biebl@debian.org>
  • Loading branch information
mbiebl committed Jan 26, 2021
1 parent 3973d0d commit 19f12d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sos/report/plugins/systemd.py
Expand Up @@ -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",
Expand 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",
Expand Down

0 comments on commit 19f12d0

Please sign in to comment.