[pve-devel] [PATCH v4 manager 0/5] PVE Ceph Jewel V4

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


slight touch-ups to Wolfgang's patch series, only patches which changed are
patch #1 and #4, the full diff is included below

Wolfgang Link (5):
  add systemd replacement for ceph init script
  add jewel
  Set correct permission for ceph user.
  replace SysV init script with our own service
  Enable service for ceph monitor.

 bin/init.d/Makefile     | 12 +++++++++++-
 PVE/API2/Ceph.pm        | 13 +++++++++++++
 PVE/CLI/pveceph.pm      | 13 ++++++++++++-
 bin/init.d/ceph.service | 12 ++++++++++++
 bin/init.d/pve.conf     |  2 ++
 5 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 bin/init.d/ceph.service
 create mode 100644 bin/init.d/pve.conf

-- 
2.1.4

diff --git a/bin/init.d/Makefile b/bin/init.d/Makefile
index 14c8659..aaa147a 100644
--- a/bin/init.d/Makefile
+++ b/bin/init.d/Makefile
@@ -17,8 +17,7 @@ SERVICES=			\
 	pve-manager.service 	\
 	pvedaemon.service  	\
 	pveproxy.service 	\
-	spiceproxy.service 	\
-	pve-ceph-disk.service
+	spiceproxy.service
 
 .PHONY: install 
 install: ${SCRIPTS}
@@ -34,6 +33,8 @@ install: ${SCRIPTS}
 	install -m 0644 pve.conf ${SERVICEDIR}/ceph-disk at .service.d
 	install -d ${SERVICEDIR}/ceph-mds at .service.d
 	install -m 0644 pve.conf ${SERVICEDIR}/ceph-mds at .service.d
+	install -d ${DESTDIR}/usr/share/doc/{$PACKAGE}/examples/
+	install -m 0644 ceph.service ${DESTDIR}/usr/share/doc/${PACKAGE}/examples/ceph.service
 
 .PHONY: clean
 clean:
diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index 240372d..d877fc1 100755
--- a/PVE/CLI/pveceph.pm
+++ b/PVE/CLI/pveceph.pm
@@ -131,14 +131,15 @@ __PACKAGE__->register_method ({
 		'install', '--',
 		'ceph', 'ceph-common', 'gdisk');
 
-	if (PVE::CephTools::systemd_managed()) {
+	if (PVE::CephTools::systemd_managed() && ! -e '/etc/systemd/system/ceph.service') {
 	    #to disable old SysV init scripts.
-	    eval { PVE::Tools::run_command(['/bin/systemctl', 'mask', 'ceph.service']); };
-	    warn "Can't mask ceph.service\n" if $@;
-
-	    #to ensure we have the correct startup order.
-	    eval { PVE::Tools::run_command(['/bin/systemctl', 'enable', 'pve-ceph-disk.service']); };
-	    warn "Enable pve-ceph-disk.service manually\n"if $@;
+	    print "replacing ceph init script with own ceph.service\n";
+	    eval {
+		PVE::Tools::run_command('cp -v /usr/share/doc/pve-manager/examples/ceph.service /etc/systemd/system/ceph.service');
+		PVE::Tools::run_command('systemctl daemon-reload');
+		PVE::Tools::run_command('systemctl enable ceph.service');
+	    };
+	    warn "could not install ceph.service\n" if $@;
 	}
 
 	return undef;
diff --git a/bin/init.d/ceph.service b/bin/init.d/ceph.service
new file mode 100644
index 0000000..a080c46
--- /dev/null
+++ b/bin/init.d/ceph.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=PVE activate Ceph OSD disks
+After=pve-cluster.service
+Requires=pve-cluster.service
+
+[Service]
+ExecStart=/usr/sbin/ceph-disk --log-stdout activate-all
+Type=oneshot
+
+[Install]
+WantedBy=ceph.target
diff --git a/bin/init.d/pve-ceph-disk.service b/bin/init.d/pve-ceph-disk.service
deleted file mode 100644
index 1e74236..0000000
--- a/bin/init.d/pve-ceph-disk.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=PVE Ceph disks
-After=pve-cluster.service
-Requires=pve-cluster.service
-
-[Service]
-ExecStart=/usr/sbin/ceph-disk activate-all
-Type=oneshot
-
-[Install]
-WantedBy=ceph.target




More information about the pve-devel mailing list