From 439e6544cd9bb0437d7a6421813156c1ebede27f Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Tue, 11 Aug 2026 00:23:52 +0530 Subject: [PATCH] [chrony] Declare the chrony units in the services tuple Both distribution subclasses call add_journal() for their unit but neither declares a services tuple, and neither collects the service status. An sosreport from a host with clock synchronisation problems therefore has chronyc output and the journal, but nothing showing whether the daemon is enabled, running or failing to start. Plugin._collect_services() runs each entry of the tuple through is_service() and calls both add_service_status() and add_journal(), so declaring the unit adds the missing status, keeps the journal, and removes the explicit call. It also gives the plugin an enablement trigger beyond the package name, which matters here because the unit differs between distributions: chronyd on Red Hat, chrony on Debian and Ubuntu. Signed-off-by: Suraj Patil --- sos/report/plugins/chrony.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sos/report/plugins/chrony.py b/sos/report/plugins/chrony.py index cdf3bd12b6..241ce07f9f 100644 --- a/sos/report/plugins/chrony.py +++ b/sos/report/plugins/chrony.py @@ -42,16 +42,21 @@ def setup(self): class RedHatChrony(Chrony, RedHatPlugin): + + services = ('chronyd',) + def setup(self): super().setup() self.add_copy_spec([ "/etc/chrony.conf", "/var/lib/chrony/drift" ]) - self.add_journal(units="chronyd") class DebianChrony(Chrony, DebianPlugin, UbuntuPlugin): + + services = ('chrony',) + def setup(self): super().setup() self.add_copy_spec([ @@ -61,6 +66,5 @@ def setup(self): "/var/lib/chrony/chrony.drift", "/etc/default/chrony" ]) - self.add_journal(units="chrony") # vim: et ts=4 sw=4