marsadm: set-systemd-unit obeys prosumer

This commit is contained in:
Thomas Schoebel-Theuer 2020-12-09 08:54:23 +01:00 committed by Thomas Schoebel-Theuer
parent 87f9972d60
commit 9a74ff6f54

View File

@ -2200,7 +2200,12 @@ sub set_systemd_unit_phase1 {
my $want_path = "$mars/resource-$res/systemd-want";
if ($start_name) {
set_link($start_name, $unit_start_path);
my $target = _get_designated_primary($cmd, $res, 1);
my $target;
if (has_prosumer($cmd, $res)) {
$target = _get_prosumer($cmd, $res);
} else {
$target = _get_designated_primary($cmd, $res, 1);
}
if ($target) {
set_link($target, $want_path);
}