summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2026-01-24 16:44:32 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2026-01-24 23:00:12 +0000
commit7b254d786da28d0f332e83a0c730c2c099d0df48 (patch)
tree65d5a33fad663088653a2aaa4624470006f2f198
parenta574c137422e7a94d8f65692da68c51cf02ee372 (diff)
downloaddrakx-7b254d786da28d0f332e83a0c730c2c099d0df48.tar
drakx-7b254d786da28d0f332e83a0c730c2c099d0df48.tar.gz
drakx-7b254d786da28d0f332e83a0c730c2c099d0df48.tar.bz2
drakx-7b254d786da28d0f332e83a0c730c2c099d0df48.tar.xz
drakx-7b254d786da28d0f332e83a0c730c2c099d0df48.zip
Further simplify services::_systemd_services()
'systemctl list-unit-files' returns the enabled/disabled status for all native systemd services. So we only need to call 'systemctl is-enabled' for the generated services. This reduces clutter in the installer log file.
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/services.pm5
3 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index bf6b6b697..eda051acf 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- eliminate unnecessary calls to 'systemctl is-enabled' in services::services()
+ o this reduces clutter in the installer log file
- diskdrake:
o fix partitioning wizard
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 8a127ab68..8dc5e75c4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- eliminate unnecessary calls to 'systemctl is-enabled' in services::services()
+ o this reduces clutter in the installer log file
- fix partitioning wizard
Version 18.72 - 18 January 2026
diff --git a/perl-install/services.pm b/perl-install/services.pm
index c2230351d..d7c219edc 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -375,14 +375,15 @@ sub _systemd_services() {
my @services;
log::explanations("Detected systemd. Using systemctl introspection.");
foreach (run_program::rooted_get_stdout($::prefix, '/bin/systemctl', '--no-legend', '--no-pager', '--full', 'list-unit-files')) {
- my ($name, $type) = m!^(\S+)\.(service|socket|timer)\s+(enabled|disabled|generated)!;
+ my ($name, $type, $status) = m!^(\S+)\.(service|socket|timer)\s+(enabled|disabled|generated)!;
if ($name) {
my $unit_name = "$name.$type";
# We only look at non-template, non-linked service files in /lib
# We also check for any non-masked sysvinit files as these are
# also handled by systemd
if ($name !~ /.*\@$/g && (-e "$::prefix/lib/systemd/system/$unit_name" or -e "$::prefix/etc/rc.d/init.d/$name") && ! -l "$::prefix/lib/systemd/system/$unit_name") {
- push @services, [ _list_name($name, $type), !!run_program::rooted($::prefix, '/bin/systemctl', '--quiet', 'is-enabled', "$unit_name") ];
+ my $enabled = $status eq 'enabled' || $status eq 'generated' && !!run_program::rooted($::prefix, '/bin/systemctl', '--quiet', 'is-enabled', $unit_name);
+ push @services, [ _list_name($name, $type), $enabled ];
}
}
}