[pve-devel] [PATCH v4 manager 5/5] Enable service for ceph monitor.

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Dec 21 15:56:16 CET 2016


From: Wolfgang Link <w.link at proxmox.com>

We do not use the ceph.service what normally start ceph-mon,
so we have to ensure ceph-mon is enabled.
---
 PVE/API2/Ceph.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index be56fcd..9411a4f 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -948,6 +948,12 @@ __PACKAGE__->register_method ({
 	    PVE::CephTools::write_ceph_config($cfg);
 
 	    PVE::CephTools::ceph_service_cmd('start', $monsection);
+
+	    if ($systemd_managed) {
+		#to ensure we have the correct startup order.
+		eval { PVE::Tools::run_command(['/bin/systemctl', 'enable', "ceph-mon\@${monid}.service"]); };
+		warn "Enable ceph-mon\@${monid}.service manually"if $@;
+	    }
 	};
 
 	return $rpcenv->fork_worker('cephcreatemon', $monsection, $authuser, $worker);
-- 
2.1.4





More information about the pve-devel mailing list