6 Jun 2023 |
ElvishJerricco | oddlama: Maybe you're missing a kernel module relating to this? | 14:36:38 |
ElvishJerricco | but that's weird because in nixos we have a wants relationship from multi-user.target on systemd-networkd.service | 14:37:27 |
oddlama | In reply to @elvishjerricco:matrix.org oddlama: Maybe you're missing a kernel module relating to this? Since this is stage2 I don't see how that could be a problem.. Which module would you have in mind? | 14:39:34 |
oddlama | Hard to find any information about route 1361 | 14:39:42 |
ElvishJerricco | no clue :P | 14:39:45 |
oddlama | occurrs exactly once in systemd's source, in networkd.socket :/ | 14:39:59 |
oddlama | * occurs exactly once in systemd's source, in networkd.socket :/ | 14:40:05 |
oddlama | In reply to @elvishjerricco:matrix.org but that's weird because in nixos we have a wants relationship from multi-user.target on systemd-networkd.service where is that relationship defined? | 14:42:13 |
ElvishJerricco | https://github.com/NixOS/nixpkgs/blob/5c31944c1d468476f7827943dd636b34478db22b/nixos/modules/system/boot/networkd.nix#L3129 | 14:42:43 |
ElvishJerricco | oddlama: Something else kinda weird is that on my system that has networkd enabled in both stage 1 and stage 2, I don't see the same messages from the socket unit about "Incoming traffic" | 14:44:21 |
ElvishJerricco | your default.target is multi-user.target , right? :P | 14:45:03 |
oddlama | In reply to @elvishjerricco:matrix.org oddlama: Something else kinda weird is that on my system that has networkd enabled in both stage 1 and stage 2, I don't see the same messages from the socket unit about "Incoming traffic" Maybe it's also a red herring and just coincidence | 14:45:15 |
ElvishJerricco | possibly | 14:45:22 |
oddlama | In reply to @elvishjerricco:matrix.org your default.target is multi-user.target , right? :P I didn't change anything in that regard, so I hope so :D | 14:45:31 |
ElvishJerricco | (please double check, because it is possible to change) | 14:45:59 |
ElvishJerricco | (like, it shouldn't, but systemctl status default.target is easy enough :P) | 14:46:34 |
oddlama | Already on it | 14:46:46 |
oddlama | Yep, multi-user.target on both systems. | 14:46:59 |
ElvishJerricco | oddlama: As a sanity check, what's systemctl show -p WantedBy systemd-networkd.service say? | 14:48:24 |
oddlama | Just did a sanity check on the systemd issues | 14:49:39 |
oddlama | https://github.com/systemd/systemd/issues/27718 | 14:49:40 |
oddlama | In reply to @elvishjerricco:matrix.org oddlama: As a sanity check, what's systemctl show -p WantedBy systemd-networkd.service say? WantedBy=multi-user.target on both | 14:50:32 |
ElvishJerricco | Interesting tidbit from that issue that I'd like to revisit later:
networkd.service removes some (not all) IP addresses, routes, and friends on stop. Hence, restarting networkd during switching root may disconnect network. So, if the rootfs is backed by a network filesystem, system may fail to boot.
It was my understanding that this is explicitly not the case
| 14:53:49 |
ElvishJerricco | huh, ok apparently that's only true because we're not actually stopping systemd-networkd.service correctly before switch-root | 14:56:00 |
ElvishJerricco | Ok, looks like we just need Before and Conflicts on initrd-switch-root.target , and that will not only fix the bug, but also change how we need to implement flushBeforeStage2 | 14:58:18 |
ElvishJerricco | because apparently if it's stopped properly, it will flush | 14:58:35 |
ElvishJerricco | meaning with the current implementation, we won't have a way to do flushBeforeStage2 = false | 14:59:16 |
ElvishJerricco | I'm going to cook up a nixpkgs patch | 15:00:50 |
ElvishJerricco | oddlama: Can you try this in your config and see if it fixes your issue?
boot.initrd.network.flushBeforeStage2 = false;
boot.initrd.systemd = {
services.systemd-networkd = {
before = ["initrd-switch-root.target"];
conflicts = ["initrd-switch-root.target"];
};
sockets.systemd-networkd = {
before = ["initrd-switch-root.target"];
conflicts = ["initrd-switch-root.target"];
};
};
| 15:34:38 |
oddlama | Will try | 15:47:33 |