···1617my $action = shift @ARGV;
18000019if (!defined $action || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
20 print STDERR <<EOF;
21Usage: $0 [switch|boot|test]
···65sub getActiveUnits {
66 # FIXME: use D-Bus or whatever to query this, since parsing the
67 # output of list-units is likely to break.
68- my $lines = `LANG= systemctl list-units --full --no-legend`;
069 my $res = {};
70 foreach my $line (split '\n', $lines) {
71 chomp $line;
···262263sub pathToUnitName {
264 my ($path) = @_;
265- open my $cmd, "-|", "@systemd@/bin/systemd-escape", "--suffix=mount", "-p", $path
0266 or die "Unable to escape $path!\n";
267 my $escaped = join "", <$cmd>;
268 chomp $escaped;
···364if (scalar (keys %unitsToStop) > 0) {
365 print STDERR "stopping the following units: ", join(", ", @unitsToStopFiltered), "\n"
366 if scalar @unitsToStopFiltered;
367- system("systemctl", "stop", "--", sort(keys %unitsToStop)); # FIXME: ignore errors?
0368}
369370print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"
···1617my $action = shift @ARGV;
1819+if ("@localeArchive@" ne "") {
20+ $ENV{LOCALE_ARCHIVE} = "@localeArchive@";
21+}
22+23if (!defined $action || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
24 print STDERR <<EOF;
25Usage: $0 [switch|boot|test]
···69sub getActiveUnits {
70 # FIXME: use D-Bus or whatever to query this, since parsing the
71 # output of list-units is likely to break.
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`;
74 my $res = {};
75 foreach my $line (split '\n', $lines) {
76 chomp $line;
···267268sub pathToUnitName {
269 my ($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
272 or die "Unable to escape $path!\n";
273 my $escaped = join "", <$cmd>;
274 chomp $escaped;
···370if (scalar (keys %unitsToStop) > 0) {
371 print STDERR "stopping the following units: ", join(", ", @unitsToStopFiltered), "\n"
372 if scalar @unitsToStopFiltered;
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?
375}
376377print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys %unitsToSkip)), "\n"