Problems when rebooting and shutting down

I am using NixOS 24.05 with kernel 6.6.5 .The laptop is an Acer Nitro 5 Ryzen 5 Nvidia 1650 .Actually, the problems started when I updated to 23.11 .Every time I shut down or reboot the system, a message appears “stop job running for wpa_supplicant/network manager”
That is, two processes are trying to terminate and this action stretches for 5-10 minutes or does not end at all and I have to turn off by pressing the power button. in configurations.nix I have only network manager enabled because I use Gnome.
This problem appears when upgrading from kernel 6.1.63 to later versions. How to solve this problem without rolling back to previous generations?

Check the journal; what happens in those 5-10min?

IIRC there was a kernel bug in 6.6.5 regarding some WiFi chips. Does the same happen with the non-latest linuxPackages or 6.5?

I noticed this bug when the kernel upgraded from 6.1.64 to 6.1.65. I have two laptops, one has hybrid graphics (Ryzen and Nvidia 1650 video cores), the other has an Intel UHD 600. Both have identical configurations, problems are observed on the hybrid graphics. During system shutdown a timer “task 1 of 2” appears and two processes try to terminate. The timer runs, first the value is 1,3 minutes, then 5,1 minutes, then 10,9 minutes. Sometimes after that everything hangs, sometimes shutdown occurs. I have sent the case to bugtracker.

i am also having the same problem during shutdown my nixos is not shutingdown properly that is due to wpa supplicant

here is my journal for wpasupplicant

Dez 12 21:02:25 royaleinstein systemd[1]: wpa_supplicant.service: State 'stop-sigterm' timed out. Killing.
Dez 12 21:02:25 royaleinstein systemd[1]: wpa_supplicant.service: Killing process 1447 (wpa_supplicant) with signal SIGKILL.
Dez 12 21:03:55 royaleinstein systemd[1]: wpa_supplicant.service: Processes still around after SIGKILL. Ignoring.
Dez 12 21:05:25 royaleinstein systemd[1]: wpa_supplicant.service: State 'final-sigterm' timed out. Killing.
Dez 12 21:05:25 royaleinstein systemd[1]: wpa_supplicant.service: Killing process 1447 (wpa_supplicant) with signal SIGKILL.
Dez 12 21:06:55 royaleinstein systemd[1]: wpa_supplicant.service: Processes still around after final SIGKILL. Entering failed mode.
Dez 12 21:06:55 royaleinstein systemd[1]: wpa_supplicant.service: Failed with result 'timeout'.
Dez 12 21:06:55 royaleinstein systemd[1]: wpa_supplicant.service: Unit process 1447 (wpa_supplicant) remains running after unit stopped.
Dez 12 21:06:55 royaleinstein systemd[1]: Stopped WPA Supplicant instance.
Dez 12 21:06:55 royaleinstein systemd[1]: wpa_supplicant.service: Consumed 36ms CPU time, read 3.7M from disk, written 0B to disk, no IP traffic.
-- Boot 14b33b80c58344a4885e921b8505b968 --

need help i am not able to shutdown my laptop for 10 mins or sometimes more

I have the same thing in the journalctl. the rfkill can’t kill network manager and wpa_supplicant(it’s disabled in configuration.nix explicitly). This bug appeared in kernel 6.1.63 and has not been fixed yet.

I’m having the same issue with the latest kernel 6.6.5 update on a system76 pangolin 12, it hangs on shut down. it works perfectly on 6.6.3, but I need the latest kernel as microphone on the pangolin doesn’t work unless I have > than 6.4 kernel


You can see the errors at the bottom of the screenshot.

Thank you all for trying to help me. I rebuilt the system with the 6.6.4 zen kernel and the problem disappeared. I looked at the nixos-rebuild boot error output and there are a lot of bugs in the 6.6.5 kernel. My mobile nvidia 1650 is marked as unsupported, the usb host driver was not unloading (I think all the problems are due to this), wifi problems. As I said, the problem was solved by switching to kernel 6.6.4 zen. Thank you all.

I have this exact problem too, though I was on kernel 6.1.66. I tried upgrading to 6.6.4, but when I use boot.kernelPackages = pkgs.linuxPackages_6_6; it upgrades to kernel 6.6.5, which is exactly the one you say is broken :sweat_smile:

How do I set the kernel to be 6.6.4 as you did? Hopefully that fixes my problem too.

To get the latest kernel, use boot.kernelPackages = pkgs.linuxPackages_latest
This option is currently used to boot kernel 6.6.7. There are a lot of bugs and bugs in this kernel. For example, wifi was crashing every three minutes, video driver was not unloaded. so I switched to boot.kernelPackages = pkgs.linuxPackages_zen . The zen kernel of the latest versions is more elaborate. The current version is 6.6.6.

Update: Updating to the latest default kernel (version 6.1.18 as of writing) has fixed this for me.

Other versions that I tested and worked: 6.6.1-zen1, 6.6.4, 6.6.7
Version that I tried and did not work: 6.1.66, 6.6.5


I switched to 6.6.4 and that fixed it for me as well:

  boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_6_6.override {
    argsOverride = rec {
      src = pkgs.fetchurl {
        url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
        sha256 = "sha256-SeSWYMk9jW1Y8Rg2DTyoExaV7DRmkmPKjwQch22pPkU=";
      };
      version = "6.6.4";
      modDirVersion = "6.6.4";
    };
  });

I’m trying out boot.kernelPackages = pkgs.linuxPackages_zen; now, will report back.

Edit:

Using boot.kernelPackages = pkgs.linuxPackages_zen; actually results in kernel version 6.6.1-zen1:

❯ uname -r
6.6.1-zen1

This version also works for me though.

Trying latest next.

Edit:

So tried latest, that was 6.6.5, but I’m using flakes, so updated those and that changed the latest to be 6.6.7. That version (6.6.7) shuts down properly, but 6.6.5 does not.

With that update of flake, the default kernel was also updated to be 6.1.68, so trying that one now.

Edit:

So, version 6.1.68 also works for me. So I’ll leave it at this, basically just running nix flake update fixed it for me, without the need to set a specific kernel version.

I suppose you could also work around it by reducing the shutdown timeout, something like:

systemd.services.wpa_supplicant.serviceConfig.TimeoutSec = "10";

Not a fix to the underlying problem, of course, but it seems like the primary symptom anyone cares about is how long shutdown takes.

I’m using an unstable branch, so when the 23.11 release came out I immediately upgraded to 24.05. The default kernel on this system is 6.1.63, updated to 6.1.64 the next day. I use a classic NixOS configuration without flakes where everything is declared in onfiguration.nix
Using boot.kernelPackages = pkgs.linuxPackages_latest_zen; actually results in kernel version 6.6.6-zen1 for me.


The thing is that the bug with infinite system shutdown only manifests itself during shutdown(…). rfkill tries to kill two processes, wpa_supplicant and network manager. But the thing is that I’m using Gnome, and according to the NixOS Wiki it is recommended to configure these services through system settings without making any changes to configuration.nix

I had the same problem (shutting down hanged on WIFI and Network). Finding this discussion was key to fixing it. Kernels 6.6.5 and 6.1.66 have the problem. Putting:

boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;

in configuration.nix followed by

# sudo nixos-rebuild boot
# sudo reboot (which hanged)

got kernel 6.6.4 and that does not hang when shutting down.

By the way, I read that the developer of xanmod kernel has stopped developing his project.

Where did you read that? Because that’d be news to me. The 6.7 xanmod release was yesterday.

I read here

You misinterpreted that, it’s just a variant of that kernel that hadn’t seen updates in a while. That specific kernel package was removed from nixpkgs for that reason. The project itself is still going strong: https://xanmod.org/

That PR is also well over a year old, and some NixOS PR is far from an authorative source on the xanmod kernel’s continuation. Ironically @Atemu also reviewed the PR in question so would have been among the first to know.

1 Like