···16161717my $action = shift @ARGV;
18181919+if ("@localeArchive@" ne "") {
2020+ $ENV{LOCALE_ARCHIVE} = "@localeArchive@";
2121+}
2222+1923if (!defined $action || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
2024 print STDERR <<EOF;
2125Usage: $0 [switch|boot|test]
···6569sub getActiveUnits {
6670 # FIXME: use D-Bus or whatever to query this, since parsing the
6771 # output of list-units is likely to break.
6868- my $lines = `LANG= systemctl list-units --full --no-legend`;
7272+ # Use current version of systemctl binary before daemon is reexeced.
7373+ my $lines = `LANG= /run/current-system/sw/bin/systemctl list-units --full --no-legend`;
6974 my $res = {};
7075 foreach my $line (split '\n', $lines) {
7176 chomp $line;
···262267263268sub pathToUnitName {
264269 my ($path) = @_;
265265- open my $cmd, "-|", "@systemd@/bin/systemd-escape", "--suffix=mount", "-p", $path
270270+ # Use current version of systemctl binary before daemon is reexeced.
271271+ open my $cmd, "-|", "/run/current-system/sw/bin/systemd-escape", "--suffix=mount", "-p", $path
266272 or die "Unable to escape $path!\n";
267273 my $escaped = join "", <$cmd>;
268274 chomp $escaped;
···364370if (scalar (keys %unitsToStop) > 0) {
365371 print STDERR "stopping the following units: ", join(", ", @unitsToStopFiltered), "\n"
366372 if scalar @unitsToStopFiltered;
367367- system("systemctl", "stop", "--", sort(keys %unitsToStop)); # FIXME: ignore errors?
373373+ # Use current version of systemctl binary before daemon is reexeced.
374374+ system("/run/current-system/sw/bin/systemctl", "stop", "--", sort(keys %unitsToStop)); # FIXME: ignore errors?
368375}
369376370377print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"