add systemd replacement for ceph init script

the old sys V init script does a lot of stuff, most of which
is already replaced with the system units since jewel,
except for the OSD activation which is still done by either
udev or the old init script.

include systemd service as drop in replacement for the init
script when using jewel. the service is not enabled by
default (as this would break hammer), but needs to be copied
to /etc/systemd/system on upgrade to (manual) or install of
jewel (automatic).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Wolfgang Link 2016-12-21 15:56:12 +01:00 committed by Dietmar Maurer
parent d43f704212
commit b8fb9fb028
3 changed files with 24 additions and 1 deletions

View File

@ -17,7 +17,7 @@ SERVICES= \
pve-manager.service \
pvedaemon.service \
pveproxy.service \
spiceproxy.service
spiceproxy.service
.PHONY: install
install: ${SCRIPTS}
@ -25,6 +25,16 @@ install: ${SCRIPTS}
install -m 0755 ${SCRIPTS} ${INITDBINDIR}
install -d ${SERVICEDIR}
install -m 0644 ${SERVICES} ${SERVICEDIR}
install -d ${SERVICEDIR}/ceph-mon@.service.d
install -m 0644 pve.conf ${SERVICEDIR}/ceph-mon@.service.d
install -d ${SERVICEDIR}/ceph-osd@.service.d
install -m 0644 pve.conf ${SERVICEDIR}/ceph-osd@.service.d
install -d ${SERVICEDIR}/ceph-disk@.service.d
install -m 0644 pve.conf ${SERVICEDIR}/ceph-disk@.service.d
install -d ${SERVICEDIR}/ceph-mds@.service.d
install -m 0644 pve.conf ${SERVICEDIR}/ceph-mds@.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:

11
bin/init.d/ceph.service Normal file
View File

@ -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

2
bin/init.d/pve.conf Normal file
View File

@ -0,0 +1,2 @@
[Unit]
After=pve-cluster.service