Skip to content

Commit

Permalink
Merge pull request #212 from rahilarious/user-systemd-unit
Browse files Browse the repository at this point in the history
create dedicated systemd user service unit
  • Loading branch information
navidys authored Mar 16, 2024
2 parents d81481b + 66be30e commit c60842c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions contrib/systemd/user/prometheus-podman-exporter.service
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion prometheus-podman-exporter.spec.rpkg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c60842c

Please sign in to comment.