Skip to content

Commit

Permalink
systemd use default.target + users environment file path
Browse files Browse the repository at this point in the history
Signed-off-by: Navid Yaghoobi <[email protected]>
  • Loading branch information
navidys committed Mar 16, 2024
1 parent c60842c commit b912a20
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
WantedBy=default.target
1 change: 1 addition & 0 deletions contrib/systemd/user/prometheus-podman-exporter.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=Prometheus exporter for podman (v4) machine
[Service]
Restart=on-failure
EnvironmentFile=-/etc/sysconfig/prometheus-podman-exporter
EnvironmentFile=-%h/.config/prometheus-podman-exporter
ExecStart=/usr/bin/prometheus-podman-exporter $PODMAN_EXPORTER_OPTS
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
Expand Down
4 changes: 2 additions & 2 deletions prometheus-podman-exporter.spec.rpkg
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ 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/system/%{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -Dpm0644 ./contrib/systemd/system/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -Dpm0644 ./contrib/systemd/user/%{name}.service %{buildroot}%{_userunitdir}/%{name}.service

pushd %{buildroot}%{_unitdir}
Expand Down

0 comments on commit b912a20

Please sign in to comment.