From c6b40cde85205061885e4a03c8fe468a28067658 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 17 May 2018 10:45:36 +0200 Subject: [PATCH] marsadm: also delete systemd-want when necessary --- userspace/marsadm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/userspace/marsadm b/userspace/marsadm index 5b8c83a4..4b37886d 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -538,20 +538,22 @@ sub set_systemd_unit { my $replac = _systemd_escape($res); $stop_name = $pre . $replac . $post; } + my $want_path = "$mars/resource-$res/systemd-want"; if ($start_name) { set_link($start_name, $unit_start_path); + my $primary = _get_designated_primary($res, 1); + if ($primary) { + set_link($primary, $want_path); + } } else { _create_delete($unit_start_path); + _create_delete($want_path); } if ($stop_name) { set_link($stop_name, $unit_stop_path); } else { _create_delete($unit_stop_path); - } - my $primary = _get_designated_primary($res, 1); - if ($primary) { - my $want_path = "$mars/resource-$res/systemd-want"; - set_link($primary, $want_path); + _create_delete($want_path); } finish_links(); _systemd_trigger($cmd);