From 8a15bfe4a1363ed08e4d5f121bfcd169a6deef9b Mon Sep 17 00:00:00 2001 From: Navid Yaghoobi Date: Sat, 16 Mar 2024 17:57:17 +1100 Subject: [PATCH] rpm spec update Signed-off-by: Navid Yaghoobi --- contrib/systemd/prometheus-podman-exporter.service | 3 ++- contrib/systemd/prometheus-podman-exporter.sysconfig | 1 + prometheus-podman-exporter.spec.rpkg | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 contrib/systemd/prometheus-podman-exporter.sysconfig diff --git a/contrib/systemd/prometheus-podman-exporter.service b/contrib/systemd/prometheus-podman-exporter.service index f767c843..46fd38ee 100644 --- a/contrib/systemd/prometheus-podman-exporter.service +++ b/contrib/systemd/prometheus-podman-exporter.service @@ -2,7 +2,8 @@ Description=Prometheus exporter for podman (v4) machine [Service] Restart=on-failure -ExecStart=/usr/bin/prometheus-podman-exporter --collector.enable-all +EnvironmentFile=-/etc/sysconfig/prometheus-podman-exporter +ExecStart=/usr/bin/prometheus-podman-exporter $PODMAN_EXPORTER_OPTS ExecReload=/bin/kill -HUP $MAINPID TimeoutStopSec=20s SendSIGKILL=no diff --git a/contrib/systemd/prometheus-podman-exporter.sysconfig b/contrib/systemd/prometheus-podman-exporter.sysconfig new file mode 100644 index 00000000..273e1517 --- /dev/null +++ b/contrib/systemd/prometheus-podman-exporter.sysconfig @@ -0,0 +1 @@ +PODMAN_EXPORTER_OPTS="--collector.enable-all" diff --git a/prometheus-podman-exporter.spec.rpkg b/prometheus-podman-exporter.spec.rpkg index 6ebd4fdc..abf23f70 100644 --- a/prometheus-podman-exporter.spec.rpkg +++ b/prometheus-podman-exporter.spec.rpkg @@ -57,6 +57,7 @@ install -dp %{buildroot}%{_bindir} install -dp %{buildroot}%{_unitdir} install -dp %{buildroot}%{_userunitdir} install -p ./bin/%{name} %{buildroot}%{_bindir} +install -Dpm0644 ./contrib/systemd/%{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name} install -Dpm0644 ./contrib/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -Dpm0644 ./contrib/systemd/%{name}.service %{buildroot}%{_userunitdir}/%{name}.service @@ -82,6 +83,7 @@ popd %doc README.md MAINTAINERS.md SECURITY.md CONTRIBUTING.md CODE_OF_CONDUCT.md %{_bindir}/%{name} %{_bindir}/%{shortname} +%{_sysconfdir}/sysconfig/%{name} %{_unitdir}/%{name}.service %{_unitdir}/%{shortname}.service %{_userunitdir}/%{name}.service