[pve-devel] [PATCH manager 08/20] ceph: mon: use ceph_service_cmd to enable/disable the systemd service

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 14:47:47 CEST 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index d5872b42..c7d5e915 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -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();
 	};
 
-- 
2.11.0





More information about the pve-devel mailing list