From: Aaron Merey Date: Fri, 10 Aug 2018 17:15:45 +0000 (-0400) Subject: systemtap.spec: add stap-exporter package X-Git-Tag: release-4.0~144 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=09bb438450a543ff780b31d88029dc5c8dce2226;p=systemtap.git systemtap.spec: add stap-exporter package --- diff --git a/systemtap.spec b/systemtap.spec index 55d787a50..c50715238 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -462,6 +462,20 @@ This package includes support files needed to run systemtap scripts that probe python 3 processes. %endif +%if %{with_python3} +%package stap-exporter +Summary: Systemtap-prometheus interoperation mechanism +Group: Development/System +License: GPLv2+ +URL: http://sourceware.org/systemtap/ +Requires: systemtap-runtime = %{version}-%{release} + +%description stap-exporter +This package includes files for a systemd service that manages +systemtap sessions and relays prometheus metrics from the sessions +to remote requesters on demand. +%endif + %if %{with_virthost} %package runtime-virthost Summary: Systemtap Cross-VM Instrumentation - host @@ -760,6 +774,13 @@ done touch $RPM_BUILD_ROOT%{dracutstap}/params.conf %endif +%if %{with_python3} + mkdir -p $RPM_BUILD_ROOT/stap-exporter + install -p -m 755 stap-exporter/stap-exporter $RPM_BUILD_ROOT%{_bindir} + install -m 644 stap-exporter/stap-exporter.service $RPM_BUILD_ROOT%{_unitdir} + install -m 644 stap-exporter/stap-exporter.8* $RPM_BUILD_ROOT%{_mandir}/man8 +%endif + %pre runtime getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr getent group stapsys >/dev/null || groupadd -g 157 -r stapsys 2>/dev/null || groupadd -r stapsys @@ -935,6 +956,13 @@ if [ "$1" -ge "1" ]; then fi exit 0 +%if %{with_python3} +%preun stap-exporter +/bin/systemctl stop stap-exporter.service >/dev/null 2>&1 || : +/bin/systemctl disable stap-exporter.service >/dev/null 2>&1 || : +%endif + + %post # Remove any previously-built uprobes.ko materials (make -C %{_datadir}/systemtap/runtime/uprobes clean) >/dev/null 2>&1 || true @@ -1220,6 +1248,13 @@ done %endif %endif +%if %{with_python3} +%files stap-exporter +%{_unitdir}/stap-exporter.service +%{_mandir}/man8/stap-exporter.8* +%{_bindir}/stap-exporter +%endif + # ------------------------------------------------------------------------ # Future new-release entries should be of the form