From 69b66599609c6513de8d72c45fe327312b0b81ac Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 7 Oct 2021 08:10:41 -0600 Subject: 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 --- contrib/systemd/system/podman-restart.service | 12 ------------ contrib/systemd/system/podman-restart.service.in | 12 ++++++++++++ contrib/systemd/system/podman.service | 15 --------------- contrib/systemd/system/podman.service.in | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 contrib/systemd/system/podman-restart.service create mode 100644 contrib/systemd/system/podman-restart.service.in delete mode 100644 contrib/systemd/system/podman.service create mode 100644 contrib/systemd/system/podman.service.in (limited to 'contrib/systemd/system') diff --git a/contrib/systemd/system/podman-restart.service b/contrib/systemd/system/podman-restart.service deleted file mode 100644 index baf12b3ae..000000000 --- a/contrib/systemd/system/podman-restart.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Podman Start All Containers With Restart Policy Set To Always -Documentation=man:podman-start(1) -StartLimitIntervalSec=0 - -[Service] -Type=oneshot -Environment=LOGGING="--log-level=info" -ExecStart=/usr/bin/podman $LOGGING start --all --filter restart-policy=always - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/system/podman-restart.service.in b/contrib/systemd/system/podman-restart.service.in new file mode 100644 index 000000000..a2951e111 --- /dev/null +++ b/contrib/systemd/system/podman-restart.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=Podman Start All Containers With Restart Policy Set To Always +Documentation=man:podman-start(1) +StartLimitIntervalSec=0 + +[Service] +Type=oneshot +Environment=LOGGING="--log-level=info" +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 deleted file mode 100644 index cefb13ae3..000000000 --- a/contrib/systemd/system/podman.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Podman API Service -Requires=podman.socket -After=podman.socket -Documentation=man:podman-system-service(1) -StartLimitIntervalSec=0 - -[Service] -Type=exec -KillMode=process -Environment=LOGGING="--log-level=info" -ExecStart=/usr/bin/podman $LOGGING system service - -[Install] -WantedBy=multi-user.target diff --git a/contrib/systemd/system/podman.service.in b/contrib/systemd/system/podman.service.in new file mode 100644 index 000000000..132671dff --- /dev/null +++ b/contrib/systemd/system/podman.service.in @@ -0,0 +1,15 @@ +[Unit] +Description=Podman API Service +Requires=podman.socket +After=podman.socket +Documentation=man:podman-system-service(1) +StartLimitIntervalSec=0 + +[Service] +Type=exec +KillMode=process +Environment=LOGGING="--log-level=info" +ExecStart=@@PODMAN@@ $LOGGING system service + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf