diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install/NEWS | 4 | ||||
-rw-r--r-- | perl-install/services.pm | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 1db4c40f8..61f04dada 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,7 @@ +- summary: + o fix not listing some services (mga#17288) + o fix updating firewall status after configuration (mga#17288) + Version 17.42 - 22 June 2016 - bootloader configuration: diff --git a/perl-install/services.pm b/perl-install/services.pm index 6c8b79943..9d3450231 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -360,8 +360,13 @@ sub _systemd_services() { my %loaded; # Running system using systemd log::explanations("Detected systemd running. Using systemctl introspection."); - foreach (run_program::rooted_get_stdout($::prefix, '/bin/systemctl', '--no-legend', '--no-pager', '--full', '--all', 'list-units')) { - if (my ($name) = m!^(\S+)\.service\s+loaded!) { + # even if systemd is not running, we can detect status of shorewell service which is not wanted by: + my @opts = $::isInstall ? 'list-unit-files' : qw(--all list-units); + print "chroot $::prefix /bin/systemctl --no-legend --no-pager --full @opts"; + foreach (run_program::rooted_get_stdout($::prefix, '/bin/systemctl', '--no-legend', '--no-pager', '--full', @opts)) { + my ($name) = m!^(\S+)\.service\s+loaded!; + ($name) = m!^(\S+)\.service\s+enabled! if $::isInstall && !$name; + if ($name) { # 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 @@ -459,6 +464,12 @@ sub services() { @services = _systemd_services(); } else { @services = _legacy_services(); + # list shorewall and the like which are not "wantedBy": + if ($::isInstall) { + # prevent listing some services twice: + my @found = map { $_->[0] } @services; + push @services, grep { !member($_->[0], @found) } _systemd_services(); + } } my @l = xinetd_services(); |