NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.12k stars 14.15k forks source link

`systemctl kexec` stopped working #345978

Open arianvp opened 1 month ago

arianvp commented 1 month ago

Describe the bug

Seems systemd added extra checks to systemctl that make it fail before our custom prepare-kexec.service runs.

Oct 02 16:35:28 ip-10-0-2-111.ec2.internal systemctl[2974]: No kexec kernel loaded and autodetection failed.
Oct 02 16:35:28 ip-10-0-2-111.ec2.internal systemctl[2974]: Automatic loading works only on systems booted with EFI.
Oct 02 16:35:28 ip-10-0-2-111.ec2.internal systemd[1]: deploy-user-data.service: Main process exited, code=exited, status=1/FAILURE
Oct 02 16:35:28 ip-10-0-2-111.ec2.internal systemd[1]: deploy-user-data.service: Failed with result 'exit-code'.
Oct 02 16:35:28 ip-10-0-2-111.ec2.internal systemd[1]: Failed to start deploy-user-data.service.

Steps To Reproduce

nixos-rebuild boot && systemctl kexec

Expected behavior

https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/kexec.nix gets pulled in and then kexec happens.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

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"
output here

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

arianvp commented 1 month ago

systemctl start kexec.target does still work as expected. Perhaps we should just update the docs.

Problem is that systemctl kexec checks if a kernel and bails out if there isn't any.

It didnt use to do that. And that would mean prepare-kexec.service would get pulled in just in time to load the kernel