@@ -16,6 +16,10 @@ my $reloadListFile = "/run/systemd/reload-list";
1616
1717my $action = shift @ARGV;
1818
19+if ("@localeArchive@" ne "") {
20+ $ENV{LOCALE_ARCHIVE} = "@localeArchive@";
21+}
22+
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]
@@ -65,7 +69,8 @@ $SIG{PIPE} = "IGNORE";
6569sub getActiveUnits {
6670 # FIXME: use D-Bus or whatever to query this, since parsing the
6771 # output of list-units is likely to break.
68− my $lines = `LANG= systemctl list-units --full --no-legend`;
72+ # Use current version of systemctl binary before daemon is reexeced.
73+ 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;
@@ -262,7 +267,8 @@ while (my ($unit, $state) = each %{$activePrev}) {
262267
263268sub pathToUnitName {
264269 my ($path) = @_;
265− open my $cmd, "-|", "@systemd@/bin/systemd-escape", "--suffix=mount", "-p", $path
270+ # Use current version of systemctl binary before daemon is reexeced.
271+ 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;
@@ -364,7 +370,8 @@ syslog(LOG_NOTICE, "switching to system configuration $out");
364370if (scalar (keys %unitsToStop) > 0) {
365371 print STDERR "stopping the following units: ", join(", ", @unitsToStopFiltered), "\n"
366372 if scalar @unitsToStopFiltered;
367− system("systemctl", "stop", "--", sort(keys %unitsToStop)); # FIXME: ignore errors?
373+ # Use current version of systemctl binary before daemon is reexeced.
374+ system("/run/current-system/sw/bin/systemctl", "stop", "--", sort(keys %unitsToStop)); # FIXME: ignore errors?
368375}
369376
370377print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"