NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.6k stars 13.76k forks source link

NetworkManager-wait-online.service times out #296953

Open raboof opened 6 months ago

raboof commented 6 months ago

Describe the bug

When I 'nixos-rebuild switch', this takes a long time, as NetworkManager-wait-online.service is timing out. The network seems to work fine, though.

I set networking.networkmanager.logLevel to DEBUG, but this didn't turn up anything obvious in journalctl yet.

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.5, NixOS, 24.05 (Uakari), 24.05.20240316.c75037b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-20.03pre194293.2436c27541b"`
 - nixpkgs: `/home/aengelen/nixpkgs`

Add a :+1: reaction to issues you find important.

sdht0 commented 6 months ago

See #247608.

I use:

systemd.services.NetworkManager-wait-online = {
    serviceConfig = {
      ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
    };
  };
raboof commented 6 months ago

See #247608.

Thanks for the reference! I don't think I have networking.useNetworkd enabled, though - unclear whether it's the same issue?

I use:

systemd.services.NetworkManager-wait-online = {
    serviceConfig = {
      ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
    };
  };

haven't checked what that does, but it indeed does appear to make switching fast again :)

sdht0 commented 6 months ago

Yeah I actually took it from https://github.com/NixOS/nixpkgs/issues/180175#issuecomment-1658731959. Found it now.