summaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /systemd
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'systemd')
-rw-r--r--systemd/50-ceph.preset8
-rw-r--r--systemd/CMakeLists.txt35
-rw-r--r--systemd/ceph-crash.service.in13
-rw-r--r--systemd/ceph-fuse.target7
-rw-r--r--systemd/ceph-fuse@.service.in26
-rw-r--r--systemd/ceph-mds.target9
-rw-r--r--systemd/ceph-mds@.service.in31
-rw-r--r--systemd/ceph-mgr.target9
-rw-r--r--systemd/ceph-mgr@.service.in33
-rw-r--r--systemd/ceph-mon.target8
-rw-r--r--systemd/ceph-mon@.service.in37
-rw-r--r--systemd/ceph-osd.target9
-rw-r--r--systemd/ceph-osd@.service.in33
-rw-r--r--systemd/ceph-radosgw.target9
-rw-r--r--systemd/ceph-radosgw@.service.in30
-rw-r--r--systemd/ceph-rbd-mirror.target7
-rw-r--r--systemd/ceph-rbd-mirror@.service.in30
-rw-r--r--systemd/ceph-volume@.service14
-rw-r--r--systemd/ceph.target5
-rw-r--r--systemd/ceph.tmpfiles.d1
-rw-r--r--systemd/rbdmap.service.in17
21 files changed, 371 insertions, 0 deletions
diff --git a/systemd/50-ceph.preset b/systemd/50-ceph.preset
new file mode 100644
index 00000000..ca8f4d2c
--- /dev/null
+++ b/systemd/50-ceph.preset
@@ -0,0 +1,8 @@
+enable ceph.target
+enable ceph-mds.target
+enable ceph-mgr.target
+enable ceph-mon.target
+enable ceph-osd.target
+enable ceph-rbd-mirror.target
+enable ceph-radosgw.target
+enable ceph-crash.service
diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt
new file mode 100644
index 00000000..56be619d
--- /dev/null
+++ b/systemd/CMakeLists.txt
@@ -0,0 +1,35 @@
+set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_LIBEXECDIR}/systemd/system"
+ CACHE PATH "Location for systemd service files")
+set(CEPH_SYSTEMD_ENV_DIR "/etc/sysconfig"
+ CACHE PATH "Location for systemd service environmental variable settings files")
+set(SYSTEMD_ENV_FILE "${CEPH_SYSTEMD_ENV_DIR}/ceph")
+foreach(service
+ ceph-crash
+ ceph-fuse@
+ ceph-mds@
+ ceph-mgr@
+ ceph-mon@
+ ceph-osd@
+ ceph-radosgw@
+ ceph-rbd-mirror@
+ rbdmap)
+ configure_file(
+ ${service}.service.in
+ ${service}.service
+ @ONLY)
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${service}.service
+ DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR})
+endforeach()
+
+install(FILES
+ ceph.target
+ ceph-fuse.target
+ ceph-osd.target
+ ceph-mgr.target
+ ceph-mon.target
+ ceph-mds.target
+ ceph-radosgw.target
+ ceph-rbd-mirror.target
+ ceph-volume@.service
+ DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR})
diff --git a/systemd/ceph-crash.service.in b/systemd/ceph-crash.service.in
new file mode 100644
index 00000000..8304dd61
--- /dev/null
+++ b/systemd/ceph-crash.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Ceph crash dump collector
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/ceph-crash
+Restart=always
+RestartSec=10
+StartLimitInterval=10min
+StartLimitBurst=10
+
+[Install]
+WantedBy=ceph.target
diff --git a/systemd/ceph-fuse.target b/systemd/ceph-fuse.target
new file mode 100644
index 00000000..c31fdfa8
--- /dev/null
+++ b/systemd/ceph-fuse.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-fuse@.service instances at once
+PartOf=ceph.target
+Before=ceph.target
+
+[Install]
+WantedBy=remote-fs.target ceph.target
diff --git a/systemd/ceph-fuse@.service.in b/systemd/ceph-fuse@.service.in
new file mode 100644
index 00000000..d603042b
--- /dev/null
+++ b/systemd/ceph-fuse@.service.in
@@ -0,0 +1,26 @@
+[Unit]
+Description=Ceph FUSE client
+After=network-online.target local-fs.target time-sync.target
+Wants=network-online.target local-fs.target time-sync.target
+Conflicts=umount.target
+PartOf=ceph-fuse.target
+
+[Service]
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-fuse -f --cluster ${CLUSTER} %I
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+# ceph-fuse requires access to /dev fuse device
+PrivateDevices=no
+ProtectControlGroups=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=3
+
+[Install]
+WantedBy=ceph-fuse.target
diff --git a/systemd/ceph-mds.target b/systemd/ceph-mds.target
new file mode 100644
index 00000000..1101f21f
--- /dev/null
+++ b/systemd/ceph-mds.target
@@ -0,0 +1,9 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mds@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-mds@.service.in b/systemd/ceph-mds@.service.in
new file mode 100644
index 00000000..e47738a2
--- /dev/null
+++ b/systemd/ceph-mds@.service.in
@@ -0,0 +1,31 @@
+[Unit]
+Description=Ceph metadata server daemon
+PartOf=ceph-mds.target
+After=network-online.target local-fs.target time-sync.target
+Before=remote-fs-pre.target ceph-mds.target
+Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target ceph-mds.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-mds -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecReload=/bin/kill -HUP $MAINPID
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateDevices=yes
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+PrivateTmp=true
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=3
+
+[Install]
+WantedBy=ceph-mds.target
diff --git a/systemd/ceph-mgr.target b/systemd/ceph-mgr.target
new file mode 100644
index 00000000..288888b0
--- /dev/null
+++ b/systemd/ceph-mgr.target
@@ -0,0 +1,9 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mgr@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-mgr@.service.in b/systemd/ceph-mgr@.service.in
new file mode 100644
index 00000000..0ff9db23
--- /dev/null
+++ b/systemd/ceph-mgr@.service.in
@@ -0,0 +1,33 @@
+[Unit]
+Description=Ceph cluster manager daemon
+PartOf=ceph-mgr.target
+After=network-online.target local-fs.target time-sync.target
+Before=remote-fs-pre.target ceph-mgr.target
+Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target ceph-mgr.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-mgr -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecReload=/bin/kill -HUP $MAINPID
+LockPersonality=true
+# We need to disable this protection as some python libraries generate
+# dynamic code, like python-cffi, and require mmap calls to succeed
+MemoryDenyWriteExecute=false
+NoNewPrivileges=true
+PrivateDevices=yes
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+PrivateTmp=true
+Restart=on-failure
+RestartSec=10
+StartLimitInterval=30min
+StartLimitBurst=3
+
+[Install]
+WantedBy=ceph-mgr.target
diff --git a/systemd/ceph-mon.target b/systemd/ceph-mon.target
new file mode 100644
index 00000000..4325bac7
--- /dev/null
+++ b/systemd/ceph-mon.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mon@.service instances at once
+PartOf=ceph.target
+Before=ceph.target
+Wants=ceph.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-mon@.service.in b/systemd/ceph-mon@.service.in
new file mode 100644
index 00000000..d3121d59
--- /dev/null
+++ b/systemd/ceph-mon@.service.in
@@ -0,0 +1,37 @@
+[Unit]
+Description=Ceph cluster monitor daemon
+PartOf=ceph-mon.target
+# According to:
+# http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
+# these can be removed once ceph-mon will dynamically change network
+# configuration.
+After=network-online.target local-fs.target time-sync.target
+Before=remote-fs-pre.target ceph-mon.target
+Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target ceph-mon.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecReload=/bin/kill -HUP $MAINPID
+LockPersonality=true
+MemoryDenyWriteExecute=true
+# Need NewPrivileges via `sudo smartctl`
+NoNewPrivileges=false
+PrivateDevices=yes
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+PrivateTmp=true
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=5
+RestartSec=10
+
+[Install]
+WantedBy=ceph-mon.target
diff --git a/systemd/ceph-osd.target b/systemd/ceph-osd.target
new file mode 100644
index 00000000..e4d1b9f0
--- /dev/null
+++ b/systemd/ceph-osd.target
@@ -0,0 +1,9 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-osd@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-osd@.service.in b/systemd/ceph-osd@.service.in
new file mode 100644
index 00000000..2e5ea6ae
--- /dev/null
+++ b/systemd/ceph-osd@.service.in
@@ -0,0 +1,33 @@
+[Unit]
+Description=Ceph object storage daemon osd.%i
+PartOf=ceph-osd.target
+After=network-online.target local-fs.target time-sync.target
+Before=remote-fs-pre.target ceph-osd.target
+Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target ceph-osd.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecStartPre=/usr/lib/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
+ExecReload=/bin/kill -HUP $MAINPID
+LockPersonality=true
+MemoryDenyWriteExecute=true
+# Need NewPrivileges via `sudo smartctl`
+NoNewPrivileges=false
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+# flushing filestore requires access to /proc/sys/vm/drop_caches
+ProtectKernelTunables=false
+ProtectSystem=full
+PrivateTmp=true
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=3
+
+[Install]
+WantedBy=ceph-osd.target
diff --git a/systemd/ceph-radosgw.target b/systemd/ceph-radosgw.target
new file mode 100644
index 00000000..8ea707a0
--- /dev/null
+++ b/systemd/ceph-radosgw.target
@@ -0,0 +1,9 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-radosgw@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-radosgw@.service.in b/systemd/ceph-radosgw@.service.in
new file mode 100644
index 00000000..dee501b4
--- /dev/null
+++ b/systemd/ceph-radosgw@.service.in
@@ -0,0 +1,30 @@
+[Unit]
+Description=Ceph rados gateway
+PartOf=ceph-radosgw.target
+After=network-online.target local-fs.target time-sync.target
+Before=remote-fs-pre.target ceph-radosgw.target
+Wants=network-online.target local-fs.target time-sync.target remote-fs-pre.target ceph-radosgw.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/radosgw -f --cluster ${CLUSTER} --name client.%i --setuser ceph --setgroup ceph
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateDevices=yes
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+PrivateTmp=true
+TasksMax=infinity
+Restart=on-failure
+StartLimitInterval=30s
+StartLimitBurst=5
+
+[Install]
+WantedBy=ceph-radosgw.target
diff --git a/systemd/ceph-rbd-mirror.target b/systemd/ceph-rbd-mirror.target
new file mode 100644
index 00000000..57ea09f1
--- /dev/null
+++ b/systemd/ceph-rbd-mirror.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-rbd-mirror@.service instances at once
+PartOf=ceph.target
+Before=ceph.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
diff --git a/systemd/ceph-rbd-mirror@.service.in b/systemd/ceph-rbd-mirror@.service.in
new file mode 100644
index 00000000..1b0d38b9
--- /dev/null
+++ b/systemd/ceph-rbd-mirror@.service.in
@@ -0,0 +1,30 @@
+[Unit]
+Description=Ceph rbd mirror daemon
+After=network-online.target local-fs.target
+Wants=network-online.target local-fs.target
+PartOf=ceph-rbd-mirror.target
+
+[Service]
+LimitNOFILE=1048576
+LimitNPROC=1048576
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=CLUSTER=ceph
+ExecStart=/usr/bin/rbd-mirror -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecReload=/bin/kill -HUP $MAINPID
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateDevices=yes
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+PrivateTmp=true
+Restart=on-failure
+StartLimitInterval=30min
+StartLimitBurst=3
+TasksMax=infinity
+
+[Install]
+WantedBy=ceph-rbd-mirror.target
diff --git a/systemd/ceph-volume@.service b/systemd/ceph-volume@.service
new file mode 100644
index 00000000..c21002ce
--- /dev/null
+++ b/systemd/ceph-volume@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Ceph Volume activation: %i
+After=local-fs.target
+Wants=local-fs.target
+
+[Service]
+Type=oneshot
+KillMode=none
+Environment=CEPH_VOLUME_TIMEOUT=10000
+ExecStart=/bin/sh -c 'timeout $CEPH_VOLUME_TIMEOUT /usr/sbin/ceph-volume-systemd %i'
+TimeoutSec=0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/ceph.target b/systemd/ceph.target
new file mode 100644
index 00000000..67a982c5
--- /dev/null
+++ b/systemd/ceph.target
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph*@.service instances at once
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/ceph.tmpfiles.d b/systemd/ceph.tmpfiles.d
new file mode 100644
index 00000000..2ded82f5
--- /dev/null
+++ b/systemd/ceph.tmpfiles.d
@@ -0,0 +1 @@
+d /run/ceph 0770 ceph ceph -
diff --git a/systemd/rbdmap.service.in b/systemd/rbdmap.service.in
new file mode 100644
index 00000000..6644508c
--- /dev/null
+++ b/systemd/rbdmap.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Map RBD devices
+After=network-online.target ceph.target
+Before=remote-fs-pre.target
+Wants=network-online.target remote-fs-pre.target ceph.target
+
+[Service]
+EnvironmentFile=-@SYSTEMD_ENV_FILE@
+Environment=RBDMAPFILE=/etc/ceph/rbdmap
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/rbdmap map
+ExecReload=/usr/bin/rbdmap map
+ExecStop=/usr/bin/rbdmap unmap-all
+
+[Install]
+WantedBy=multi-user.target