enh(linux/local): mode systemd-sc-status - manage new output (#3319)

This commit is contained in:
qgarnier 2021-12-13 08:36:08 +01:00 committed by GitHub
parent c7611a8300
commit b5fa560051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -117,7 +117,7 @@ sub manage_selection {
my ($stdout) = $options{custom}->execute_command(
command => 'systemctl',
command_options => '-a --no-pager --no-legend'
command_options => '-a --no-pager --no-legend --plain'
);
$self->{global} = { running => 0, exited => 0, failed => 0, dead => 0, total => 0 };
@ -145,12 +145,15 @@ sub manage_selection {
($stdout) = $options{custom}->execute_command(
command => 'systemctl',
command_options => 'list-unit-files --no-pager --no-legend'
command_options => 'list-unit-files --no-pager --no-legend --plain'
);
#runlevel4.target enabled
#runlevel5.target static
#runlevel6.target disabled
while ($stdout =~ /^(.*?)\s+(\S+)\s*$/msig) {
# vendor preset is a new column
#UNIT FILE STATE VENDOR PRESET
#runlevel4.target enabled
#runlevel5.target static
#runlevel6.target disabled
#irqbalance.service enabled enabled
while ($stdout =~ /^(.*?)\s+(\S+)\s*/msig) {
my ($name, $boot) = ($1, $2);
next if (!defined($self->{sc}->{$name}));
$self->{sc}->{$name}->{boot} = $boot;