switch-to-configuration: Use old systemctl to stop units
Otherwise, when switching from systemd 203 to 212, you get errors like: Failed to stop remote-fs.target: Bad message Failed to stop systemd-udevd-control.socket: Bad message ...
This commit is contained in:
parent
6eaced3582
commit
56b4b841ae
@ -65,7 +65,7 @@ $SIG{PIPE} = "IGNORE";
|
|||||||
sub getActiveUnits {
|
sub getActiveUnits {
|
||||||
# FIXME: use D-Bus or whatever to query this, since parsing the
|
# FIXME: use D-Bus or whatever to query this, since parsing the
|
||||||
# output of list-units is likely to break.
|
# output of list-units is likely to break.
|
||||||
my $lines = `LANG= @systemd@/bin/systemctl list-units --full --no-legend`;
|
my $lines = `LANG= systemctl list-units --full --no-legend`;
|
||||||
my $res = {};
|
my $res = {};
|
||||||
foreach my $line (split '\n', $lines) {
|
foreach my $line (split '\n', $lines) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
@ -297,7 +297,7 @@ foreach my $device (keys %$prevSwaps) {
|
|||||||
if (scalar @unitsToStop > 0) {
|
if (scalar @unitsToStop > 0) {
|
||||||
@unitsToStop = unique(@unitsToStop);
|
@unitsToStop = unique(@unitsToStop);
|
||||||
print STDERR "stopping the following units: ", join(", ", sort(@unitsToStop)), "\n";
|
print STDERR "stopping the following units: ", join(", ", sort(@unitsToStop)), "\n";
|
||||||
system("@systemd@/bin/systemctl", "stop", "--", @unitsToStop); # FIXME: ignore errors?
|
system("systemctl", "stop", "--", @unitsToStop); # FIXME: ignore errors?
|
||||||
}
|
}
|
||||||
|
|
||||||
print STDERR "NOT restarting the following units: ", join(", ", sort(@unitsToSkip)), "\n"
|
print STDERR "NOT restarting the following units: ", join(", ", sort(@unitsToSkip)), "\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user