[pve-devel] [PATCH V2 pve-manager] Include systemd service to ensure the correct order on start.

Wolfgang Link w.link at proxmox.com
Tue Dec 20 10:44:53 CET 2016


The pve-ceph-disk.service ensure that ceph will start after pve-cluster and mount the osd-disks.
This is essential because ceph (osd, mon, mds, disks) need the ceph.conf which is located in the pmxcfs.
Also there is a race condition in the ceph.serivce scritps, what end in a stopped osd.

To use this service you have to unmask the ceph.service and enable the pve-ceph-disk.service
---
 bin/init.d/Makefile              | 11 ++++++++++-
 bin/init.d/pve-ceph-disk.service | 12 ++++++++++++
 bin/init.d/pve.conf              |  2 ++
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 bin/init.d/pve-ceph-disk.service
 create mode 100644 bin/init.d/pve.conf

add "Type=oneshot"

diff --git a/bin/init.d/Makefile b/bin/init.d/Makefile
index 76498b7..14c8659 100644
--- a/bin/init.d/Makefile
+++ b/bin/init.d/Makefile
@@ -17,7 +17,8 @@ SERVICES=			\
 	pve-manager.service 	\
 	pvedaemon.service  	\
 	pveproxy.service 	\
-	spiceproxy.service 
+	spiceproxy.service 	\
+	pve-ceph-disk.service
 
 .PHONY: install 
 install: ${SCRIPTS}
@@ -25,6 +26,14 @@ install: ${SCRIPTS}
 	install -m 0755 ${SCRIPTS} ${INITDBINDIR}
 	install -d ${SERVICEDIR}
 	install -m 0644 ${SERVICES} ${SERVICEDIR}
+	install -d ${SERVICEDIR}/ceph-mon at .service.d
+	install -m 0644 pve.conf ${SERVICEDIR}/ceph-mon at .service.d
+	install -d ${SERVICEDIR}/ceph-osd at .service.d
+	install -m 0644 pve.conf ${SERVICEDIR}/ceph-osd at .service.d
+	install -d ${SERVICEDIR}/ceph-disk at .service.d
+	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
 
 .PHONY: clean
 clean:
diff --git a/bin/init.d/pve-ceph-disk.service b/bin/init.d/pve-ceph-disk.service
new file mode 100644
index 0000000..15d83b3
--- /dev/null
+++ b/bin/init.d/pve-ceph-disk.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=PVE Ceph disks
+After=pve-cluster.service
+Requires=pve-cluster.service
+
+[Service]
+ExecStart=/usr/sbin/ceph-disk activate-all
+Type=oneshot
+
+[Install]
+RequiredBy=ceph-mon at .service ceph-mds at .service ceph-osd at .service ceph-disk at .service
+WantedBy=ceph.target
diff --git a/bin/init.d/pve.conf b/bin/init.d/pve.conf
new file mode 100644
index 0000000..655dbc7
--- /dev/null
+++ b/bin/init.d/pve.conf
@@ -0,0 +1,2 @@
+[Unit]
+After=pve-ceph-disk.service
-- 
2.1.4





More information about the pve-devel mailing list