networking: Fix timeout when `lo` has aliased IPs

With a config like

    {
      networking.interfaces."lo".ip4 = [
        { address = "10.8.8.8"; prefixLength = 32; }
      ];
    }

a nixos-rebuild switch would take a long time, and you'd see:

    $ systemctl list-jobs
       JOB UNIT                                TYPE  STATE
    734400 network-interfaces.target           start waiting
    734450 sys-subsystem-net-devices-lo.device start running
    734449 network-link-lo.service             start waiting

and:

    systemd[1]: sys-subsystem-net-devices-lo.device: Job sys-subsystem-net-devices-lo.device/star>
    systemd[1]: sys-subsystem-net-devices-lo.device: Job sys-subsystem-net-devices-lo.device/star>
    systemd[1]: Timed out waiting for device sys-subsystem-net-devices-lo.device.

This removes the device dependency for `lo` and fixes this bug.

Closes #7227

(cherry picked from commit 48d292e8a14bec3926dc3963e167859b35fc60af)
release-18.03-flake
Graham Christensen 2018-07-06 15:33:05 -04:00
parent 072b99dff2
commit f872318e76
No known key found for this signature in database
GPG Key ID: ACA1C1D120C83D5C
1 changed files with 1 additions and 1 deletions

View File

@ -1098,7 +1098,7 @@ in
};
} // (listToAttrs (flip map interfaces (i:
let
deviceDependency = if config.boot.isContainer
deviceDependency = if (config.boot.isContainer || i.name == "lo")
then []
else [ (subsystemDevice i.name) ];
in