summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2024-05-25 10:23:06 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2024-05-25 10:26:19 -0700
commitd72d66d2986700cc377c197d4cf19e91d266f597 (patch)
tree397a280c0379698ebeee3241d5b570012ba0602b /app-metrics
parentsys-kernel/gentoo-sources: drop 6.8.8 (diff)
downloadgentoo-d72d66d2986700cc377c197d4cf19e91d266f597.tar.gz
gentoo-d72d66d2986700cc377c197d4cf19e91d266f597.tar.bz2
gentoo-d72d66d2986700cc377c197d4cf19e91d266f597.zip
app-metrics/smartctl_exporter: bump
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/smartctl_exporter/Manifest2
-rw-r--r--app-metrics/smartctl_exporter/files/smartctl_exporter.confd2
-rw-r--r--app-metrics/smartctl_exporter/files/smartctl_exporter.initd23
-rw-r--r--app-metrics/smartctl_exporter/files/smartctl_exporter.service22
-rw-r--r--app-metrics/smartctl_exporter/smartctl_exporter-0.12.0.ebuild57
5 files changed, 106 insertions, 0 deletions
diff --git a/app-metrics/smartctl_exporter/Manifest b/app-metrics/smartctl_exporter/Manifest
index 5e8be5f843f2..cbc7769c0037 100644
--- a/app-metrics/smartctl_exporter/Manifest
+++ b/app-metrics/smartctl_exporter/Manifest
@@ -1,2 +1,4 @@
DIST smartctl_exporter-0.11.0-vendor.tar.xz 1348836 BLAKE2B 06999c2df7891d6579a227dc5eab44240f923f3466ce1da8443bc40afcb7d9c493f94d50a083ea26e03969b89c9cff4e977f9cffc8529dac5c323212c139dd9e SHA512 c54bf342e56db7086a3844d96f910a18b9d0e19a434b554421e9c70b02fdf3b2307da6662a0e02de93adedf9484444bbbcb7225659b26273e6106cbf73aa3dbd
DIST smartctl_exporter-0.11.0.tar.gz 29097 BLAKE2B 7e3d85588a83380f8d579a918677d9910ba1922212af65b1918a379315e9f2321f617c5d884fd72086019ddac353817da5d1ec71a8a8b0ecb3edb24f66dd75fa SHA512 2c86d051d17c55e3122130ad4733c5911310698a89d8782a61f3b5541cb7aa689994338125eaa5ee41fdcddbdd8316a6736c734ff5dee6fe0d6c0a2b131fff66
+DIST smartctl_exporter-0.12.0-vendor.tar.xz 1400804 BLAKE2B 5c4ba0440860c86d3a3bd84308c97a6fe1eaf231776ed64840f6ebd3cad533bab5f8b97ee9f4c3d573b08442fc66f565c8b83a7f70fea889cf2e9e1337ce24cc SHA512 28e235eb6e560042ae0783a1fb1276ff07dff5e838f1f2d6a93886f0fdea85151b1c1c87c8476d42524f7e563a58ae30f354fa1138a93fcbe0f39ff7bcba0b3d
+DIST smartctl_exporter-0.12.0.tar.gz 91406 BLAKE2B 9ab0fa3e4dcee1e21a566cd9677b99f579f60e761d40d9ab1dd75380bbff9c189d9895ee2e914d1b6bdeee0c5b6d185c71ae62f4ce7585b3954192091cc96e25 SHA512 8f2cc973fd967c9ab737dcaa7456f019cb574ac3297bd5d15559167cde51f8076bcb48c7befb7efb869e056c1c5e404f4bb2774e8fe020736354ede4ae3e77f3
diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.confd b/app-metrics/smartctl_exporter/files/smartctl_exporter.confd
new file mode 100644
index 000000000000..5a8a1d649a60
--- /dev/null
+++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for smartctl exporter
+command_args=""
diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.initd b/app-metrics/smartctl_exporter/files/smartctl_exporter.initd
new file mode 100644
index 000000000000..b9e18a61449a
--- /dev/null
+++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 2016-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="smartctl metrics exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=root
+group=root
+
+command="/usr/bin/smartctl_exporter"
+command_args="${command_args}"
+command_background="true"
+command_user="${user}:${group}"
+output_log="/var/log/smartctl_exporter/${RC_SVCNAME}.log"
+error_log="/var/log/smartctl_exporter/${RC_SVCNAME}.log"
+
+depend() {
+ after net
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 -o ${user}:${group} /var/log/smartctl_exporter
+}
diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.service b/app-metrics/smartctl_exporter/files/smartctl_exporter.service
new file mode 100644
index 000000000000..c21aa5af5283
--- /dev/null
+++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=smartctl exporter
+Documentation=https://github.com/prometheus-community/smartctl_exporter
+After=network-online.target
+
+[Service]
+# Security improvements required in future, but needs care; ideally
+# smartctl_exporter runs minimal privilege, but can invoke smartctl via sudo to
+# touch disks.
+# https://github.com/prometheus-community/smartctl_exporter/issues/146
+User=root
+Group=root
+Restart=on-failure
+Type=exec
+# TODO: find a good way to add args here
+ExecStart=/usr/sbin/smartctl_exporter
+ExecReload=/usr/bin/kill -HUP $MAINPID
+TimeoutStopSec=20s
+SendSIGKILL=no
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-metrics/smartctl_exporter/smartctl_exporter-0.12.0.ebuild b/app-metrics/smartctl_exporter/smartctl_exporter-0.12.0.ebuild
new file mode 100644
index 000000000000..7f438ca5ce66
--- /dev/null
+++ b/app-metrics/smartctl_exporter/smartctl_exporter-0.12.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit go-module systemd
+
+DESCRIPTION="Export smartctl statistics to prometheus"
+HOMEPAGE="https://github.com/prometheus-community/smartctl_exporter"
+
+# uncomment the first setting of MY_PV for a normal release
+# MY_PV="v${PV/_rc/-rc.}"
+# set MY_PV to the full commit hash for a snapshot release
+MY_PV_HASH=
+: ${MY_PV_HASH_FOR_VENDOR:=${MY_PV_HASH}}
+if [[ -n "${MY_PV_HASH}" ]]; then
+ MY_PV=${MY_PV_HASH}
+ SMARTCTL_EXPORTER_COMMIT=${MY_PV_HASH:0:8}
+ SRC_URI_UPSTREAM="${HOMEPAGE}/archive/${MY_PV}.tar.gz"
+else
+ MY_PV=$PV
+ SMARTCTL_EXPORTER_COMMIT=
+ SRC_URI_UPSTREAM="${HOMEPAGE}/archive/refs/tags/v${PV}.tar.gz"
+fi
+MY_P=${PN}-${MY_PV}
+SRC_URI_VENDOR="https://dev.gentoo.org/~robbat2/distfiles/${MY_P}-vendor.tar.xz"
+SRC_URI="
+ ${SRC_URI_UPSTREAM} -> ${P}.tar.gz
+ ${SRC_URI_VENDOR}
+ "
+
+# Upstream LICENSE file is wrong see https://github.com/prometheus-community/smartctl_exporter/pull/113
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+BDEPEND="dev-util/promu"
+DEPEND="dev-lang/go"
+RDEPEND="sys-apps/smartmontools"
+
+src_prepare() {
+ default
+ if [[ -n $SMARTCTL_EXPORTER_COMMIT ]]; then
+ sed -i -e "s/{{.Revision}}/${SMARTCTL_EXPORTER_COMMIT}/" .promu.yml || die
+ fi
+}
+
+src_compile() {
+ emake build PROMU='/usr/bin/promu'
+}
+
+src_install() {
+ dodoc *.md
+ dobin ${PN}
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+}