aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-10-07 08:10:41 -0600
committerEd Santiago <santiago@redhat.com>2021-10-12 07:57:26 -0600
commit69b66599609c6513de8d72c45fe327312b0b81ac (patch)
tree0b853ab073495cd8f779da80250cc716b90c54f4 /contrib
parent2fcec59445267e8c8e06005539701a172d3db8a5 (diff)
downloadpodman-69b66599609c6513de8d72c45fe327312b0b81ac.tar.gz
podman-69b66599609c6513de8d72c45fe327312b0b81ac.tar.bz2
podman-69b66599609c6513de8d72c45fe327312b0b81ac.zip
Unit files: Use actual installed path for podman
Don't hardcode /usr/bin/podman in unit files: instead, use template files with a path replaced at install time. Because 'make' can be invoked repeatedly, with different PREFIX, do not leave the generated files behind in our work directory: wipe them immediately after install. To get this to work, fix a longstanding bug in podman.spec.in, a PREFIX that should've been DESTDIR. Side note: #7023 made contrib/systemd/user a symlink to .../system but did not update paths in Makefile. The unrelated-looking path change you see here is a belated correction for that. Fixes: #10787 Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/spec/podman.spec.in2
-rw-r--r--contrib/systemd/auto-update/podman-auto-update.service.in (renamed from contrib/systemd/auto-update/podman-auto-update.service)4
-rw-r--r--contrib/systemd/system/podman-restart.service.in (renamed from contrib/systemd/system/podman-restart.service)2
-rw-r--r--contrib/systemd/system/podman.service.in (renamed from contrib/systemd/system/podman.service)2
4 files changed, 5 insertions, 5 deletions
diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in
index fa513932f..3a4026038 100644
--- a/contrib/spec/podman.spec.in
+++ b/contrib/spec/podman.spec.in
@@ -435,7 +435,7 @@ BUILDTAGS=$BUILDTAGS make binaries
%install
install -dp %{buildroot}%{_unitdir}
install -dp %{buildroot}%{_usr}/lib/systemd/user
-PODMAN_VERSION=%{version} %{__make} PREFIX=%{buildroot}%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \
+PODMAN_VERSION=%{version} %{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} ETCDIR=%{_sysconfdir} \
install.bin-nobuild \
install.remote-nobuild \
%if %{with doc}
diff --git a/contrib/systemd/auto-update/podman-auto-update.service b/contrib/systemd/auto-update/podman-auto-update.service.in
index dc5fac8cf..de4460d60 100644
--- a/contrib/systemd/auto-update/podman-auto-update.service
+++ b/contrib/systemd/auto-update/podman-auto-update.service.in
@@ -6,8 +6,8 @@ After=network-online.target
[Service]
Type=oneshot
-ExecStart=/usr/bin/podman auto-update
-ExecStartPost=/usr/bin/podman image prune -f
+ExecStart=@@PODMAN@@ auto-update
+ExecStartPost=@@PODMAN@@ image prune -f
[Install]
WantedBy=multi-user.target default.target
diff --git a/contrib/systemd/system/podman-restart.service b/contrib/systemd/system/podman-restart.service.in
index baf12b3ae..a2951e111 100644
--- a/contrib/systemd/system/podman-restart.service
+++ b/contrib/systemd/system/podman-restart.service.in
@@ -6,7 +6,7 @@ StartLimitIntervalSec=0
[Service]
Type=oneshot
Environment=LOGGING="--log-level=info"
-ExecStart=/usr/bin/podman $LOGGING start --all --filter restart-policy=always
+ExecStart=@@PODMAN@@ $LOGGING start --all --filter restart-policy=always
[Install]
WantedBy=multi-user.target
diff --git a/contrib/systemd/system/podman.service b/contrib/systemd/system/podman.service.in
index cefb13ae3..132671dff 100644
--- a/contrib/systemd/system/podman.service
+++ b/contrib/systemd/system/podman.service.in
@@ -9,7 +9,7 @@ StartLimitIntervalSec=0
Type=exec
KillMode=process
Environment=LOGGING="--log-level=info"
-ExecStart=/usr/bin/podman $LOGGING system service
+ExecStart=@@PODMAN@@ $LOGGING system service
[Install]
WantedBy=multi-user.target