ceph: mon: use ceph_service_cmd to enable/disable the systemd service

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-06-04 14:47:47 +02:00 committed by Thomas Lamprecht
parent b521573040
commit da92b5fcce

View File

@ -249,7 +249,7 @@ __PACKAGE__->register_method ({
PVE::Ceph::Services::ceph_service_cmd('start', $monsection);
# to ensure we have the correct startup order.
eval { run_command(['/bin/systemctl', 'enable', "ceph-mon\@${monid}.service"]) };
eval { PVE::Ceph::Services::ceph_service_cmd('enable', $monsection) };
warn "Enable ceph-mon\@${monid}.service failed, do manually: $@\n" if $@;
waitpid($create_keys_pid, 0);
}
@ -323,6 +323,8 @@ __PACKAGE__->register_method ({
delete $cfg->{$monsection};
cfs_write_file('ceph.conf', $cfg);
File::Path::remove_tree($mondir);
eval { PVE::Ceph::Services::ceph_service_cmd('disable', $monsection) };
warn $@ if $@;
PVE::Ceph::Services::broadcast_ceph_services();
};