systemd: add systemd unit file for ceph-exporter

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
This commit is contained in:
Shinya Hayashi 2024-02-05 04:16:26 +00:00
parent a53c0651fb
commit 32cbe079c6
4 changed files with 32 additions and 0 deletions

View File

@ -2052,6 +2052,7 @@ fi
%files -n ceph-exporter
%{_bindir}/ceph-exporter
%{_unitdir}/ceph-exporter.service
%files -n rbd-fuse
%{_bindir}/rbd-fuse

View File

@ -1 +1,2 @@
lib/systemd/system/ceph-exporter*
usr/bin/ceph-exporter

View File

@ -14,6 +14,7 @@ set(CEPH_SYSTEMD_ENV_DIR "/etc/sysconfig"
set(SYSTEMD_ENV_FILE "${CEPH_SYSTEMD_ENV_DIR}/ceph")
foreach(service
ceph-crash
ceph-exporter
ceph-fuse@
ceph-mds@
ceph-mgr@

View File

@ -0,0 +1,29 @@
[Unit]
Description=Ceph cluster exporter daemon
PartOf=ceph.target
After=network-online.target local-fs.target
Before=ceph.target
Wants=network-online.target local-fs.target ceph.target ceph-mon.target
[Service]
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/ceph-exporter -f --id %i --setuser ceph --setgroup ceph
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=yes
PrivateTmp=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full
Restart=on-failure
RestartSec=10
RestrictSUIDSGID=true
StartLimitBurst=3
StartLimitInterval=30min
[Install]
WantedBy=multi-user.target ceph.target