From 37e6e08cdee082d9f60ab2900c960f2f594933a0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 25 Apr 2014 17:42:09 +0200 Subject: [PATCH] switch-to-configuration: Use systemctl's --no-legend flag --- nixos/modules/system/activation/switch-to-configuration.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 4cea0c5910c4..7c2d64d2e1a1 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -65,12 +65,12 @@ $SIG{PIPE} = "IGNORE"; sub getActiveUnits { # FIXME: use D-Bus or whatever to query this, since parsing the # output of list-units is likely to break. - my $lines = `LANG= @systemd@/bin/systemctl list-units --full`; + my $lines = `LANG= @systemd@/bin/systemctl list-units --full --no-legend`; my $res = {}; foreach my $line (split '\n', $lines) { chomp $line; last if $line eq ""; - $line =~ /^\*?\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s/ or next; + $line =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s/ or next; next if $1 eq "UNIT"; $res->{$1} = { load => $2, state => $3, substate => $4 }; }