diff --git a/contrib/systemd/user/prometheus-podman-exporter.service b/contrib/systemd/user/prometheus-podman-exporter.service new file mode 100644 index 00000000..8fde88a1 --- /dev/null +++ b/contrib/systemd/user/prometheus-podman-exporter.service @@ -0,0 +1,11 @@ +[Unit] +Description=Prometheus exporter for podman (v4) machine +[Service] +Restart=on-failure +EnvironmentFile=-/etc/sysconfig/prometheus-podman-exporter +ExecStart=/usr/bin/prometheus-podman-exporter $PODMAN_EXPORTER_OPTS +ExecReload=/bin/kill -HUP $MAINPID +TimeoutStopSec=20s +SendSIGKILL=no +[Install] +WantedBy=default.target diff --git a/prometheus-podman-exporter.spec.rpkg b/prometheus-podman-exporter.spec.rpkg index 45a976f4..3a641c3e 100644 --- a/prometheus-podman-exporter.spec.rpkg +++ b/prometheus-podman-exporter.spec.rpkg @@ -59,7 +59,7 @@ 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 +install -Dpm0644 ./contrib/systemd/user/%{name}.service %{buildroot}%{_userunitdir}/%{name}.service pushd %{buildroot}%{_unitdir} ln -s %{name}.service %{shortname}.service