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 e985d872ab
commit d33c3c1f88

View File

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