From 313c38d5f1aeda1b065ba9b15380918ebd771c99 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 18 Apr 2014 18:45:46 +0200 Subject: [PATCH] switch-to-configuration: Handle systemctl output change --- 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 13bd0b60f82..f8c1ab12ebf 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 = `@systemd@/bin/systemctl list-units --full`; + my $lines = `LANG= @systemd@/bin/systemctl list-units --full`; my $res = {}; foreach my $line (split '\n', $lines) { chomp $line; last if $line eq ""; - $line =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s/ or next; + $line =~ /^\*?\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s/ or next; next if $1 eq "UNIT"; $res->{$1} = { load => $2, state => $3, substate => $4 }; }