From 994fe442814c4d169bb0f1ee9745604928006b39 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 26 May 2024 00:07:28 +0100 Subject: gentoo auto-resync : 26:05:2024 - 00:07:27 --- app-metrics/Manifest.gz | Bin 7124 -> 7132 bytes app-metrics/smartctl_exporter/Manifest | 6 +++ .../files/smartctl_exporter.confd | 2 + .../files/smartctl_exporter.initd | 23 +++++++++ .../files/smartctl_exporter.service | 22 ++++++++ .../smartctl_exporter-0.12.0.ebuild | 57 +++++++++++++++++++++ 6 files changed, 110 insertions(+) create mode 100644 app-metrics/smartctl_exporter/files/smartctl_exporter.confd create mode 100644 app-metrics/smartctl_exporter/files/smartctl_exporter.initd create mode 100644 app-metrics/smartctl_exporter/files/smartctl_exporter.service create mode 100644 app-metrics/smartctl_exporter/smartctl_exporter-0.12.0.ebuild (limited to 'app-metrics') diff --git a/app-metrics/Manifest.gz b/app-metrics/Manifest.gz index 807288198eda..e3d2418e5eeb 100644 Binary files a/app-metrics/Manifest.gz and b/app-metrics/Manifest.gz differ diff --git a/app-metrics/smartctl_exporter/Manifest b/app-metrics/smartctl_exporter/Manifest index d05eaa181a7d..45c63d03dce1 100644 --- a/app-metrics/smartctl_exporter/Manifest +++ b/app-metrics/smartctl_exporter/Manifest @@ -1,4 +1,10 @@ +AUX smartctl_exporter.confd 50 BLAKE2B 688a7d5198a13901ff9e8559ece3d7cb43f3d1360e9388975c95a3bb79f0e686f00fce282bb68e850715e476b0bc4ab3946e5e3446b1c8d38484921f8059e24b SHA512 a8da2186192f733d6edaf77dab8287b4f9927cf2b98dc43dadc443882372d9f206b6abe83c747d460b3097395f64d3c007f6d6a004ac7070eefef30131492e13 +AUX smartctl_exporter.initd 586 BLAKE2B 36201fc557ff2fee24459d8ab5dadb61df83e70c1ee5862fc77d41f57c445463e2bc63a15fcb59f7f1ae91d9102314bcf5257fc4a22f85d0150024d53339a5f5 SHA512 605b342a7d1710aac11787933195c1d7a66ccdd1d499df77ef0e0b8397efdddb999ca3594ce595835cfabd3cf141e749df4f4659299c632473f80377b6a40b17 +AUX smartctl_exporter.service 622 BLAKE2B 28a97f2d4a2aa2956eb30001c85bf8dffb5567db7f386a897e2007aed5794177acc100e00628f7355727d2d49bee4696a7f6a303b9f827567cac9caa5a6de9b8 SHA512 2f682520b7bb99b488c9859fdf71451eadbdb18a9fb47a175fc1a4978f8573fdfb962235371e5452f2c6184661abf12f970486d8c35567f110447add7bf4f94f 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 EBUILD smartctl_exporter-0.11.0.ebuild 1360 BLAKE2B 98816436662949c516605a96d24038218969d3e55d9fe99c50846d2c7aa9147220a2308b2e069cc87b8bb233f2549020a5dbfce2991ac55b3cf190e8bb4519a0 SHA512 27173c3e973874d31a0c4486cfc78f15202668fe9f21b0fc11677ada1934e675ae2ff16a3670755996195dc195a066e1d9361cc51be77dfaeaeb87cb8916550e +EBUILD smartctl_exporter-0.12.0.ebuild 1516 BLAKE2B f16eb92346448e40c67f92b6b602dbc7f2369f0a0443f5648cc8f8ddd4779c65e2d1c85ee9df724575025a3f23fb710bc6cc4e6dcad63bb30b2a63113a7abfe0 SHA512 9fd88cb91d2cf0c065c6d3fd07b88f78d22486d1ace08e97c912f4ede74c27621d4af8bf890d3bff94d57ad6208dce9cf75895dcb5f1edd0fa21aadd170a0847 MISC metadata.xml 322 BLAKE2B 067be01a985da3e1d0126a95004d71e9638901bb5f0c2d7ab0c49896434fc2190ae2723bc1c463592a08cec887bca884138e79de847b475d8c7f847f2a22518d SHA512 faaab61fcb4237332a853c8851dd46569e90b9845f8761f9e003d826faab13b76dff55a6a66868ec53ab1b5247b94bf74e86f725a6f16a2652c1408359debdf1 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" + +} -- cgit v1.2.3