mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Also use list-unit-files to find disabled units https://github.com/webmin/webmin/issues/430
This commit is contained in:
@@ -2023,6 +2023,14 @@ opendir(UNITS, &get_systemd_root());
|
||||
push(@units, grep { !/\.wants$/ && !/^\./ } readdir(UNITS));
|
||||
closedir(UNITS);
|
||||
|
||||
# Also add units from list-unit-files that also don't show up
|
||||
$out = &backquote_command("systemctl list-unit-files");
|
||||
foreach my $l (split(/\r?\n/, $out)) {
|
||||
if ($l =~ /^(\S+)\s+disabled/) {
|
||||
push(@units, $1);
|
||||
}
|
||||
}
|
||||
|
||||
# Skip useless units
|
||||
@units = grep { !/^sys-devices-/ &&
|
||||
!/^\-\.mount/ &&
|
||||
|
||||
Reference in New Issue
Block a user