[pve-devel] [PATCH V3 1/5] Include systemd service to ensure the correct order on start.

Wolfgang Link w.link at proxmox.com
Tue Dec 20 12:23:39 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.

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

changes V2
include Type=oneshot as f.gruenbichler noticed

changes V3
remove RequiredBy=* because this is no more needed and will replaced by
After=pve-cluster.service  in the pve.conf

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..1e74236
--- /dev/null
+++ b/bin/init.d/pve-ceph-disk.service
@@ -0,0 +1,11 @@
+[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
diff --git a/bin/init.d/pve.conf b/bin/init.d/pve.conf
new file mode 100644
index 0000000..f54bb1d
--- /dev/null
+++ b/bin/init.d/pve.conf
@@ -0,0 +1,2 @@
+[Unit]
+After=pve-cluster.service
-- 
2.1.4





More information about the pve-devel mailing list