!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
29 May 2023
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthe other difference from Wants is that if the required unit isn't present at all, the requiring unit fails01:40:17
@winterqt:nixos.devWinter (she/her)okay, last thing: how do I control what hostname is sent to the DHCP server with networkd in initrd? when using scripted stage1, i get a static lease, but with networkd, the IP... increases for whatever reason?01:40:35
@winterqt:nixos.devWinter (she/her)i think it's the hostname? no idea tho01:40:41
@elvishjerricco:matrix.org@elvishjerricco:matrix.org huh, can't say I've seen that behavior. But you can probably just set boot.initrd.systemd.contents."/etc/hostname".source = config.environment.etc.hostname.source; 01:41:55
@winterqt:nixos.devWinter (she/her)thanks, i'll give it a shot01:42:10
@winterqt:nixos.devWinter (she/her)
    requiredBy = [ "sysroot.mount" ];
    before = [ "sysroot.mount" ];
    after = [ "dev-mapper-nixos.device" ];
    bindsTo = [ "dev-mapper-nixos.device" ];

nothing redundant is here, right? just want to make sure before i reboot and have to rollback for the millionth time :/

01:42:51
@uep:matrix.org@uep:matrix.orgpresumably because your DHCP server is configured to use that hostname as the allocation, rather than the mac address01:43:06
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Winter (she/her): Also, I had to do boot.initrd.systemd.network.networks.<name>.dhcpV4Config.ClientIdentifier = "mac"; because my DHCP server on my router is a systemd-networkd one, and that was the only way I could figure out to get a statically assigned IP address to the mac address 01:43:44
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgotherwise it uses some other link identifier thingy01:44:10
@uep:matrix.org@uep:matrix.orgI keep meaning to change mine to use a combination, because there are several laptops that sometimes use a certain docking station, and they all wind up with the same IP while there01:44:16
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgbut that should be stable and it should still serve the same ip address01:44:27
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
In reply to @winterqt:nixos.dev
    requiredBy = [ "sysroot.mount" ];
    before = [ "sysroot.mount" ];
    after = [ "dev-mapper-nixos.device" ];
    bindsTo = [ "dev-mapper-nixos.device" ];

nothing redundant is here, right? just want to make sure before i reboot and have to rollback for the millionth time :/

seems fine to me
01:44:49
@winterqt:nixos.devWinter (she/her)
In reply to @uep:matrix.org
presumably because your DHCP server is configured to use that hostname as the allocation, rather than the mac address
it's using the same hostname afaict
01:44:59
@winterqt:nixos.devWinter (she/her) by this point i guess i'll just set systemd.network.enable = true ig 01:45:29
@elvishjerricco:matrix.org@elvishjerricco:matrix.org btw flushBeforeStage2 is off by default with systemd initrd networking 01:45:41
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgnot sure if that affects things01:45:46
@uep:matrix.org@uep:matrix.orgthen i wonder what changes to make the server allocate a different lease rather than reuse the existing01:45:55
@winterqt:nixos.devWinter (she/her)no clue!01:46:33
@winterqt:nixos.devWinter (she/her)very weird01:46:35
@winterqt:nixos.devWinter (she/her)as after flushing, i always get the same lease01:46:43
@winterqt:nixos.devWinter (she/her) * as after flushing in stage2, i always get the same lease01:46:55
@uep:matrix.org@uep:matrix.org(since I assumed it was some unconfigured, dynamic hostname)01:46:46
@uep:matrix.org@uep:matrix.orgperhaps some sniffing of requests is in order, assuming getting to the bottom of the issue is sufficiently interesting01:47:55
@winterqt:nixos.devWinter (she/her)
In reply to @uep:matrix.org
(since I assumed it was some unconfigured, dynamic hostname)
fun news: it's also a completely random MAC address??
18:06:12
@winterqt:nixos.devWinter (she/her)i don't think that's default networkd behavior...?18:07:11
@winterqt:nixos.devWinter (she/her)nope: https://github.com/systemd/systemd/blob/e30b4c13570a5e4ec794d480d5371e9c739570d9/network/99-default.link#L1718:07:46
@winterqt:nixos.devWinter (she/her) cc ElvishJerricco -- happy to debug this, but not sure how :) everything looks okay from the configuration's end. 18:08:30
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

Winter (she/her):

MACAddressPolicy=

persistent

If the hardware has a persistent MAC address, as most hardware should, and if it is used by the kernel, nothing is done. Otherwise, a new MAC address is generated which is guaranteed to be the same on every boot for the given machine and the given device, but which is otherwise random. This feature depends on ID_NET_NAME_* properties to exist for the link. On hardware where these properties are not set, the generation of a persistent MAC address will fail.

18:20:26
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgSo if the hardware doesn't have a persistent MAC address, then udev probably generates a MAC address based on stuff like the machine-id or something, which we don't currently add to the initrd18:21:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgso without a machine-id, I bet it becomes random18:21:19

Show newer messages


Back to Room ListRoom Version: 6