summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-12 19:39:10 +0200
committerGitHub <noreply@github.com>2021-10-12 19:39:10 +0200
commit65e156467b5cc40e14a578a6d916e4df902d0a99 (patch)
tree5dd5cf76d091a64918f098ed321f7b116c10ddfd
parent214c13da0a3958e001835288488d24f933337519 (diff)
parent69b66599609c6513de8d72c45fe327312b0b81ac (diff)
downloadpodman-65e156467b5cc40e14a578a6d916e4df902d0a99.tar.gz
podman-65e156467b5cc40e14a578a6d916e4df902d0a99.tar.bz2
podman-65e156467b5cc40e14a578a6d916e4df902d0a99.zip
Merge pull request #11886 from edsantiago/unitfile_path
Unit files: Use actual installed path for podman
-rw-r--r--Makefile17
-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
5 files changed, 18 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 590675d25..8af9cfd1b 100644
--- a/Makefile
+++ b/Makefile
@@ -770,20 +770,29 @@ install.docker-full: install.docker install.docker-docs
.PHONY: install.systemd
ifneq (,$(findstring systemd,$(BUILDTAGS)))
-install.systemd:
+PODMAN_UNIT_FILES = contrib/systemd/auto-update/podman-auto-update.service \
+ contrib/systemd/system/podman.service \
+ contrib/systemd/system/podman-restart.service
+
+%.service: %.service.in
+ sed -e 's;@@PODMAN@@;$(BINDIR)/podman;g' $< >$@.tmp.$$ \
+ && mv -f $@.tmp.$$ $@
+
+install.systemd: $(PODMAN_UNIT_FILES)
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${SYSTEMDDIR} ${DESTDIR}${USERSYSTEMDDIR}
# User services
install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.service ${DESTDIR}${USERSYSTEMDDIR}/podman-auto-update.service
install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.timer ${DESTDIR}${USERSYSTEMDDIR}/podman-auto-update.timer
- install ${SELINUXOPT} -m 644 contrib/systemd/user/podman.socket ${DESTDIR}${USERSYSTEMDDIR}/podman.socket
- install ${SELINUXOPT} -m 644 contrib/systemd/user/podman.service ${DESTDIR}${USERSYSTEMDDIR}/podman.service
- install ${SELINUXOPT} -m 644 contrib/systemd/user/podman-restart.service ${DESTDIR}${USERSYSTEMDDIR}/podman-restart.service
+ install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket ${DESTDIR}${USERSYSTEMDDIR}/podman.socket
+ install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service ${DESTDIR}${USERSYSTEMDDIR}/podman.service
+ install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service ${DESTDIR}${USERSYSTEMDDIR}/podman-restart.service
# System services
install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.service ${DESTDIR}${SYSTEMDDIR}/podman-auto-update.service
install ${SELINUXOPT} -m 644 contrib/systemd/auto-update/podman-auto-update.timer ${DESTDIR}${SYSTEMDDIR}/podman-auto-update.timer
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket ${DESTDIR}${SYSTEMDDIR}/podman.socket
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service ${DESTDIR}${SYSTEMDDIR}/podman.service
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service ${DESTDIR}${SYSTEMDDIR}/podman-restart.service
+ rm -f $(PODMAN_UNIT_FILES)
else
install.systemd:
endif
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