marsadm: allow stopping of non-enabled units

This commit is contained in:
Thomas Schoebel-Theuer 2019-02-02 21:02:09 +01:00 committed by Thomas Schoebel-Theuer
parent 0756bdc9b8
commit ec6b165ad6
1 changed files with 4 additions and 4 deletions

View File

@ -419,7 +419,7 @@ sub systemd_enabled {
sub _systemd_op {
my ($op, $unit) = @_;
if (systemd_enabled($unit)) {
if ($op eq "start" && systemd_enabled($unit)) {
return;
}
my $ctl_cmd = "$op '$unit'";
@ -461,13 +461,13 @@ sub systemd_activate {
lprint "Nothing to (de)activate: $unit_path does not exist\n" if $verbose;
return;
}
if (systemd_enabled($unit)) {
return;
}
my $ctl_cmd = "show \"$unit\"";
my $op = "show";
if ($do_activate) {
$unit =~ s/ .*//;
if (systemd_enabled($unit)) {
return;
}
lprint "==== Activate resource '$res' unit '$unit'\n"if $verbose;
$op = "start";
} else {