!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

81 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
@elvishjerricco:matrix.org@elvishjerricco:matrix.orginteresting13:06:14
@oddlama:matrix.orgoddlama
In reply to @elvishjerricco:matrix.org
oddlama: yea so the test you wrote isn't reflecting that problem unfortunately :/
The extra interfaces was the only idea I had for a cause. Do you by chance know any magic systemd stuff that allow me to log in more detail what is and isn't started? Then I can maybe just try to investigate on the actual system.
13:35:33
@oddlama:matrix.orgoddlamaWhat's also interesting is that I have multiple machines that share a lot of configuration, and the issue only appears on one of them.13:36:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.org oddlama: You can set the SYSTEMD_LOG_LEVEL=debug environment variable on services that you want more logging from, and you can set systemd.log_level=debug to get more logging from PID 1 13:38:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.org (rd.systemd.log_level=debug for stage 1 PID 1) 13:38:43
@oddlama:matrix.orgoddlama I also don't understand why you suggested that wants = ["network-pre.target"]; would be a requirement. I naively would expect systemd-networkd to be started when I have some configuration for extra interfaces 13:38:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.org network-pre.target isn't pulled in by systemd-networkd.service by default 13:39:17
@oddlama:matrix.orgoddlamaLike would that imply that the network isn't started if there's no service depending on it?13:39:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.org network-pre.target is just a target and doesn't actually do anything. On most systems, nothing comes with Before=network-pre.target, so it isn't useful to have. Things like systemd-networkd.service are still ordered After= it, but if nothing Wants= it, then it just won't be in the transaction 13:40:44
@elvishjerricco:matrix.org@elvishjerricco:matrix.org so if you have something with Before=network-pre.target but nothing with Wants=network-pre.target, then that Before= ordering does nothing 13:41:34
@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.org@elvishjerricco:matrix.org No. You're missing Wants=network-pre.target 13:47:27
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgAfter != Wants13:47:34
@oddlama:matrix.orgoddlamaAh my bad, damn terminology13:47:55
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgAfter 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.org@elvishjerricco:matrix.org* 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.org@elvishjerricco:matrix.orgNo13:49:11
@oddlama:matrix.orgoddlamaIm so lost 😂 sorry13:49:29
@elvishjerricco:matrix.org@elvishjerricco:matrix.org 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.org@elvishjerricco:matrix.orgnetwork-pre.target is an optional target in case you need to create a unit that runs before networking is started13:50:05
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBut 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.org@elvishjerricco:matrix.org 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.org@elvishjerricco:matrix.org 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.org@elvishjerricco:matrix.org I don't even remember what exactly systemd-networkd.socket is for... 14:28:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.orglike normally, when someone tries to read or write a systemd socket, the corresponding service is started14:29:00

Show newer messages


Back to Room ListRoom Version: 6