Skip to content

Quadlet network dependencies need to identify the right network{-online}.target unit #27297

@DevDorrejo

Description

@DevDorrejo

Feature request description

On openSUSE (and some other distros), network-online.target often remains inactive unless a wait-online service is explicitly enabled, while network.target is reliably reached. Quadlet’s helper (podman-user-wait-network-online.service) waits for network-online.target and times out. Quadlet should detect and wait for the correct target (online or basic) depending on the system, or allow selecting it without hacks.

Steps to reproduce

On openSUSE, run a user-scoped Quadlet unit that waits for the network (e.g., via --user).

Observe podman-user-wait-network-online.service timing out because network-online.target never becomes active.

Actual behavior

podman-user-wait-network-online.service polls network-online.target, but that target is inactive (dead). The service times out and dependent pods/units don’t start in time.

Expected behavior

Quadlet should:

Automatically detect whether to wait for network-online.target or network.target and proceed when the appropriate one is active; or

Expose an explicit option to choose the target (e.g., RequireNetwork=auto|online|basic) with auto as default and a fallback to network.target when network-online.target doesn’t progress.

Environment

Distro: openSUSE

Scope: user (systemd --user)

Networking: the system reaches network.target, but does not activate network-online.target by default.

Tools:~ # systemctl status network.target
● network.target - Network
Loaded: loaded (/usr/lib/systemd/system/network.target; static)
Active: active since Tue 2025-10-14 15:08:45 AST; 18h ago

Tools:~ # systemctl status network-online.target
○ network-online.target - Network is Online
Loaded: loaded (/usr/lib/systemd/system/network-online.target; static)
Active: inactive (dead)

Suggest potential solution

Proposed change:

Automatic mode with fallback: Adjust the Quadlet wait helper to proceed when either of these conditions are met:

network-online.target becomes active; or

If network-online.target remains inactive for N seconds, check network.target and proceed if it’s active.

Suggested shell logic (pseudocode based on current ExecStart):

/bin/sh -c '
  deadline=$(( $(date +%s) + ${QUADLET_NET_WAIT:-30} ))
  while [ "$(date +%s)" -lt "$deadline" ]; do
    systemctl is-active --quiet network-online.target && exit 0
    sleep 0.5
  done
  systemctl is-active --quiet network.target && exit 0
  while ! systemctl is-active --quiet network.target; do sleep 0.5; done

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.networkNetworking related issue or feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions