!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

79 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5127 Servers

Load older messages


SenderMessageTime
6 Jun 2023
@oddlama:matrix.orgoddlama So if I understand correctly having e.g. sshd.service enabled would suffice because it has After=network.target, and network.target in turn has After=network-pre.target 13:46:54
@elvishjerricco:matrix.orgElvishJerricco No. You're missing Wants=network-pre.target 13:47:27
@elvishjerricco:matrix.orgElvishJerriccoAfter != Wants13:47:34
@oddlama:matrix.orgoddlamaAh my bad, damn terminology13:47:55
@elvishjerricco:matrix.orgElvishJerriccoAfter and Before just creating runtime ordering requirements in the event that both units are in the transaction. Wants, Requires, and BindsTo cause units to be pulled into the transaction13:48:20
@elvishjerricco:matrix.orgElvishJerricco* After and Before just create runtime ordering requirements in the event that both units are in the transaction. Wants, Requires, and BindsTo cause units to be pulled into the transaction13:48:28
@oddlama:matrix.orgoddlamaTrue, I remember now. So the issue could be that nothing wants network-pre which means network is never started?13:49:04
@elvishjerricco:matrix.orgElvishJerriccoNo13:49:11
@oddlama:matrix.orgoddlamaIm so lost 😂 sorry13:49:29
@elvishjerricco:matrix.orgElvishJerricco You only need to want network.target to start the network, and that is pulled in by multi-user.target 13:49:35
@elvishjerricco:matrix.orgElvishJerricconetwork-pre.target is an optional target in case you need to create a unit that runs before networking is started13:50:05
@elvishjerricco:matrix.orgElvishJerriccoBut you have to pull it in with Wants to have that work13:50:16
@oddlama:matrix.orgoddlamaAhh. Since I just blindly copied the check-flush service from the existing test, why would wanting network-pre not apply to the existing test case?13:51:35
@elvishjerricco:matrix.orgElvishJerricco That probably is a mistake in the existing code :P Until I looked into this yesterday, I assumed network-pre.target was wanted by multi-user.target or network.target or something like that, but that appears not to be the case 13:53:06
@oddlama:matrix.orgoddlamaOkay that's fair. I just assumed it was something specific to my test that would require that.13:53:33
@elvishjerricco:matrix.orgElvishJerricco It's listed as a "passive" unit in man systemd.special, which I'm pretty sure means it's expected to be wanted explicitly by anything that needs it 13:54:25
@oddlama:matrix.orgoddlama

Okay the first noticeable difference between the two systems is in systemctl status systemd-networkd.socket.

broken system:

● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/etc/systemd/system/systemd-networkd.socket; enabled; preset: enabled)
    Drop-In: /nix/store/8wz1d5jpc0wnjlvl2fy6ap7cdfd8s5d8-system-units/systemd-networkd.socket.d
             └─overrides.conf
     Active: active (listening) since Tue 2023-06-06 15:53:04 CEST; 28min ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket

Jun 06 15:53:04 sentinel systemd[1]: systemd-networkd.socket: Installed new job systemd-networkd.socket/start as 274

working system:

● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/etc/systemd/system/systemd-networkd.socket; enabled; preset: enabled)
    Drop-In: /nix/store/vmjrc7h55f6vvms0xa91bb0v5skc8yfp-system-units/systemd-networkd.socket.d
             └─overrides.conf
     Active: active (running) since Tue 2023-06-06 16:11:42 CEST; 8min ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket

Jun 06 16:11:42 ward systemd[1]: systemd-networkd.socket: Installed new job systemd-networkd.socket/start as 287
Jun 06 16:11:44 ward systemd[1]: systemd-networkd.socket: Incoming traffic
Jun 06 16:11:44 ward systemd[1]: systemd-networkd.socket: Changed listening -> running
14:25:35
@oddlama:matrix.orgoddlamaThis is also pretty much the last thing related to networkd printed in the debug logs on the non-functioning system. The working system starts networkd afterwards so there's of course more.14:27:13
@elvishjerricco:matrix.orgElvishJerricco I don't even remember what exactly systemd-networkd.socket is for... 14:28:04
@elvishjerricco:matrix.orgElvishJerriccolike normally, when someone tries to read or write a systemd socket, the corresponding service is started14:29:00
@elvishjerricco:matrix.orgElvishJerricco but like shouldn't systemd-networkd be actively started? Rather than in response to something else opening the socket? 14:29:20
@oddlama:matrix.orgoddlamaThat's what I would have thought too14:29:52
@oddlama:matrix.orgoddlamaBut on the working system it is definitely the socket service which starts networkd14:30:08
@oddlama:matrix.orgoddlamaWhich could be wrong and just lead to a working system by accident14:30:28
@elvishjerricco:matrix.orgElvishJerriccoI wonder what creates the incoming traffic14:30:28
@oddlama:matrix.orgoddlamaProbably mdns14:30:33
@oddlama:matrix.orgoddlamaThe working server is in my home network14:30:46
@oddlama:matrix.orgoddlamaThe non working one is a hetzner server with a public ipv4 and no other machines on the network14:31:04
@elvishjerricco:matrix.orgElvishJerricco Hm, something tells me that the reference to man:rtnetlink(7) in the docs section of that unit is relevant 14:32:43
@elvishjerricco:matrix.orgElvishJerricco hmm: ListenNetlink=route 1361 14:36:25

Show newer messages


Back to Room ListRoom Version: 6