mirror of
https://github.com/containers/podman.git
synced 2026-02-05 06:45:31 +01: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:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,7 +4,7 @@
|
||||
/build/
|
||||
/conmon/
|
||||
contrib/spec/podman.spec
|
||||
contrib/systemd/*/*.service
|
||||
contrib/systemd/system/*.service
|
||||
*.coverprofile
|
||||
coverprofile
|
||||
/.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)${SYSTEMDDIR}/$$(basename $$unit); \
|
||||
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 $^
|
||||
else
|
||||
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
|
||||
Reference in New Issue
Block a user