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

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Dec 20 10:08:27 CET 2016


On Mon, Dec 19, 2016 at 12:36:57PM +0100, Wolfgang Link wrote:
> 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 | 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
> 
> 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..3fff72b
> --- /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

this should get a
Type=oneshot
as well.

> +
> +[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
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list