nixos/switch-to-configuration: Ignore started scopes

They are not managed by us and it might be weird to users to see units
they didn't expect to be started.
This commit is contained in:
Janne Heß 2021-10-10 12:55:00 +02:00
parent ec619ca369
commit f0a31f9b9f
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -501,7 +501,9 @@ while (my ($unit, $state) = each %{$activeNew}) {
push @failed, $unit;
}
}
elsif ($state->{state} ne "failed" && !defined $activePrev->{$unit}) {
# Ignore scopes since they are not managed by this script but rather
# created and managed by third-party services via the systemd dbus API.
elsif ($state->{state} ne "failed" && !defined $activePrev->{$unit} && $unit !~ /\.scope$/) {
push @new, $unit;
}
}