mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
add new podman-user-wait-network-online.service
This service is meant to be used by quadlet as replacement for network-online.target as this does not work for rootless users. see #22197 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
a6c4e00e9a
commit
203ab6573b
3 changed files with 16 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
/build/
|
/build/
|
||||||
/conmon/
|
/conmon/
|
||||||
contrib/spec/podman.spec
|
contrib/spec/podman.spec
|
||||||
contrib/systemd/*/*.service
|
contrib/systemd/system/*.service
|
||||||
*.coverprofile
|
*.coverprofile
|
||||||
coverprofile
|
coverprofile
|
||||||
/.coverage
|
/.coverage
|
||||||
|
|
|
||||||
3
Makefile
3
Makefile
|
|
@ -1000,6 +1000,9 @@ install.systemd: $(PODMAN_GENERATED_UNIT_FILES)
|
||||||
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${USERSYSTEMDDIR}/$$(basename $$unit); \
|
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${USERSYSTEMDDIR}/$$(basename $$unit); \
|
||||||
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${SYSTEMDDIR}/$$(basename $$unit); \
|
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${SYSTEMDDIR}/$$(basename $$unit); \
|
||||||
done
|
done
|
||||||
|
# Important this unit should only be installed for the user session and is thus not added to the loop above.
|
||||||
|
install ${SELINUXOPT} -m 644 contrib/systemd/user/podman-user-wait-network-online.service \
|
||||||
|
$(DESTDIR)${USERSYSTEMDDIR}/podman-user-wait-network-online.service
|
||||||
rm -f $^
|
rm -f $^
|
||||||
else
|
else
|
||||||
install.systemd:
|
install.systemd:
|
||||||
|
|
|
||||||
12
contrib/systemd/user/podman-user-wait-network-online.service
Normal file
12
contrib/systemd/user/podman-user-wait-network-online.service
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Wait for system level network-online.target as user.
|
||||||
|
Documentation=https://github.com/containers/podman/issues/22197
|
||||||
|
Documentation=man:podman-systemd.unit(5)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
# Set a timeout as by default oneshot does not have one and in case network-online.target
|
||||||
|
# never comes online we do not want to block forever, 90s is the default systemd unit timeout.
|
||||||
|
TimeoutStartSec=90s
|
||||||
|
ExecStart=sh -c 'until systemctl is-active network-online.target; do sleep 0.5; done'
|
||||||
|
RemainAfterExit=yes
|
||||||
Loading…
Add table
Reference in a new issue