|
| 1 | +From 0479bc612ac630b0cc5d57b7d1b7f8439152d437 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Shinya Hayashi < [email protected]> |
| 3 | +Date: Tue, 30 Jan 2024 10:32:50 +0000 |
| 4 | +Subject: [PATCH 1/2] debian: add ceph-exporter package |
| 5 | + |
| 6 | +It is hard for Debian/Ubuntu users to use ceph-exporter |
| 7 | +because it is not included in any deb packages. |
| 8 | + |
| 9 | +This commit adds a new deb package for ceph-exporter. |
| 10 | + |
| 11 | +Fixes: https://tracker.ceph.com/issues/64095 |
| 12 | +Signed-off-by: Shinya Hayashi < [email protected]> |
| 13 | +(cherry picked from commit a53c0651fbd8991e258ce7d0e3a80865dabfea88) |
| 14 | +--- |
| 15 | + debian/ceph-exporter.install | 1 + |
| 16 | + debian/control | 24 ++++++++++++++++++++++++ |
| 17 | + debian/rules | 1 + |
| 18 | + 3 files changed, 26 insertions(+) |
| 19 | + create mode 100644 debian/ceph-exporter.install |
| 20 | + |
| 21 | +diff --git a/debian/ceph-exporter.install b/debian/ceph-exporter.install |
| 22 | +new file mode 100644 |
| 23 | +index 0000000000000..618cf9eadcc1e |
| 24 | +--- /dev/null |
| 25 | ++++ b/debian/ceph-exporter.install |
| 26 | +@@ -0,0 +1 @@ |
| 27 | ++usr/bin/ceph-exporter |
| 28 | +diff --git a/debian/control b/debian/control |
| 29 | +index cb6ff92cba2c2..ddba52be7bb00 100644 |
| 30 | +--- a/debian/control |
| 31 | ++++ b/debian/control |
| 32 | +@@ -352,6 +352,30 @@ Description: debugging symbols for ceph-mgr |
| 33 | + . |
| 34 | + This package contains the debugging symbols for ceph-mgr. |
| 35 | + |
| 36 | ++Package: ceph-exporter |
| 37 | ++Architecture: linux-any |
| 38 | ++Depends: ceph-base (= ${binary:Version}), |
| 39 | ++Description: metrics exporter for the ceph distributed storage system |
| 40 | ++ Ceph is a massively scalable, open-source, distributed |
| 41 | ++ storage system that runs on commodity hardware and delivers object, |
| 42 | ++ block and file system storage. |
| 43 | ++ . |
| 44 | ++ This package contains the metrics exporter daemon, which is used to expose |
| 45 | ++ the performance metrics. |
| 46 | ++ |
| 47 | ++Package: ceph-exporter-dbg |
| 48 | ++Architecture: linux-any |
| 49 | ++Section: debug |
| 50 | ++Priority: extra |
| 51 | ++Depends: ceph-exporter (= ${binary:Version}), |
| 52 | ++ ${misc:Depends}, |
| 53 | ++Description: debugging symbols for ceph-exporter |
| 54 | ++ Ceph is a massively scalable, open-source, distributed |
| 55 | ++ storage system that runs on commodity hardware and delivers object, |
| 56 | ++ block and file system storage. |
| 57 | ++ . |
| 58 | ++ This package contains the debugging symbols for ceph-exporter. |
| 59 | ++ |
| 60 | + Package: ceph-mon |
| 61 | + Architecture: linux-any |
| 62 | + Depends: ceph-base (= ${binary:Version}), |
| 63 | +diff --git a/debian/rules b/debian/rules |
| 64 | +index ed7f4a255ed4b..68c69e0447499 100755 |
| 65 | +--- a/debian/rules |
| 66 | ++++ b/debian/rules |
| 67 | +@@ -105,6 +105,7 @@ override_dh_strip: |
| 68 | + dh_strip -pceph-mds --dbg-package=ceph-mds-dbg |
| 69 | + dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg |
| 70 | + dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg |
| 71 | ++ dh_strip -pceph-exporter --dbg-package=ceph-exporter-dbg |
| 72 | + dh_strip -pceph-mon --dbg-package=ceph-mon-dbg |
| 73 | + dh_strip -pceph-osd --dbg-package=ceph-osd-dbg |
| 74 | + dh_strip -pceph-base --dbg-package=ceph-base-dbg |
| 75 | + |
| 76 | +From 5f7da9d127c6179b7db0b62e82cae46f137129bc Mon Sep 17 00:00:00 2001 |
| 77 | +From: Shinya Hayashi < [email protected]> |
| 78 | +Date: Mon, 5 Feb 2024 04:16:26 +0000 |
| 79 | +Subject: [PATCH 2/2] systemd: add systemd unit file for ceph-exporter |
| 80 | + |
| 81 | +Signed-off-by: Shinya Hayashi < [email protected]> |
| 82 | +(cherry picked from commit 32cbe079c60031f67ee91e2f74f39244a027eba6) |
| 83 | +--- |
| 84 | + ceph.spec.in | 1 + |
| 85 | + debian/ceph-exporter.install | 1 + |
| 86 | + systemd/CMakeLists.txt | 1 + |
| 87 | + systemd/ceph-exporter.service.in | 29 +++++++++++++++++++++++++++++ |
| 88 | + 4 files changed, 32 insertions(+) |
| 89 | + create mode 100644 systemd/ceph-exporter.service.in |
| 90 | + |
| 91 | +diff --git a/ceph.spec.in b/ceph.spec.in |
| 92 | +index c4281abc5bfbb..cbbeec602e4de 100644 |
| 93 | +--- a/ceph.spec.in |
| 94 | ++++ b/ceph.spec.in |
| 95 | +@@ -2039,6 +2039,7 @@ fi |
| 96 | + |
| 97 | + %files -n ceph-exporter |
| 98 | + %{_bindir}/ceph-exporter |
| 99 | ++%{_unitdir}/ceph-exporter.service |
| 100 | + |
| 101 | + %files -n rbd-fuse |
| 102 | + %{_bindir}/rbd-fuse |
| 103 | +diff --git a/debian/ceph-exporter.install b/debian/ceph-exporter.install |
| 104 | +index 618cf9eadcc1e..1ac0edcd2a18c 100644 |
| 105 | +--- a/debian/ceph-exporter.install |
| 106 | ++++ b/debian/ceph-exporter.install |
| 107 | +@@ -1 +1,2 @@ |
| 108 | ++lib/systemd/system/ceph-exporter* |
| 109 | + usr/bin/ceph-exporter |
| 110 | +diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt |
| 111 | +index ad75ce61cd8d9..366bab4195df8 100644 |
| 112 | +--- a/systemd/CMakeLists.txt |
| 113 | ++++ b/systemd/CMakeLists.txt |
| 114 | +@@ -14,6 +14,7 @@ set(CEPH_SYSTEMD_ENV_DIR "/etc/sysconfig" |
| 115 | + set(SYSTEMD_ENV_FILE "${CEPH_SYSTEMD_ENV_DIR}/ceph") |
| 116 | + foreach(service |
| 117 | + ceph-crash |
| 118 | ++ ceph-exporter |
| 119 | + ceph-fuse@ |
| 120 | + ceph-mds@ |
| 121 | + ceph-mgr@ |
| 122 | +diff --git a/systemd/ceph-exporter.service.in b/systemd/ceph-exporter.service.in |
| 123 | +new file mode 100644 |
| 124 | +index 0000000000000..f4f6d05c4b4d4 |
| 125 | +--- /dev/null |
| 126 | ++++ b/systemd/ceph-exporter.service.in |
| 127 | +@@ -0,0 +1,29 @@ |
| 128 | ++[Unit] |
| 129 | ++Description=Ceph cluster exporter daemon |
| 130 | ++PartOf=ceph.target |
| 131 | ++After=network-online.target local-fs.target |
| 132 | ++Before=ceph.target |
| 133 | ++Wants=network-online.target local-fs.target ceph.target ceph-mon.target |
| 134 | ++ |
| 135 | ++[Service] |
| 136 | ++ExecReload=/bin/kill -HUP $MAINPID |
| 137 | ++ExecStart=/usr/bin/ceph-exporter -f --id %i --setuser ceph --setgroup ceph |
| 138 | ++LockPersonality=true |
| 139 | ++NoNewPrivileges=true |
| 140 | ++PrivateDevices=yes |
| 141 | ++PrivateTmp=true |
| 142 | ++ProtectControlGroups=true |
| 143 | ++ProtectHome=true |
| 144 | ++ProtectHostname=true |
| 145 | ++ProtectKernelLogs=true |
| 146 | ++ProtectKernelModules=true |
| 147 | ++ProtectKernelTunables=true |
| 148 | ++ProtectSystem=full |
| 149 | ++Restart=on-failure |
| 150 | ++RestartSec=10 |
| 151 | ++RestrictSUIDSGID=true |
| 152 | ++StartLimitBurst=3 |
| 153 | ++StartLimitInterval=30min |
| 154 | ++ |
| 155 | ++[Install] |
| 156 | ++WantedBy=multi-user.target ceph.target |
0 commit comments