!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

600 Members
NixOS ❤️ systemd165 Servers

Load older messages


SenderMessageTime
6 Oct 2024
@elvishjerricco:matrix.orgElvishJerricco K900: There's no stage-2-init.sh in WSL? 18:44:47
@k900:0upti.meK900{F00EFDA1-168F-4D67-A2CE-8B71D476300B}.png
Download {F00EFDA1-168F-4D67-A2CE-8B71D476300B}.png
18:44:52
@k900:0upti.meK900And nope there isn't18:44:59
@k900:0upti.meK900We do something very silly18:45:05
@elvishjerricco:matrix.orgElvishJerriccoyea systemd is PID 1 on any NixOS system; I guess the better way to say what I meant was stage-2-init-less18:45:22
@elvishjerricco:matrix.orgElvishJerricco
In reply to @k900:0upti.me
We do something very silly
what is the very silly?
18:45:31
@elvishjerricco:matrix.orgElvishJerriccoit might actually be helpful18:45:34
@elvishjerricco:matrix.orgElvishJerriccobecause I want to eliminate stage-2-init in containers18:45:45
@k900:0upti.meK900We give WSL /sbin/init18:45:46
@k900:0upti.meK900Which is a small shim binary18:45:56
@k900:0upti.meK900That runs activation and then execs into real systemd18:46:04
@elvishjerricco:matrix.orgElvishJerriccooh, so extremely similar to stage-2-init then18:46:16
@k900:0upti.meK900Yes18:46:23
@k900:0upti.meK900But stupider18:46:26
@elvishjerricco:matrix.orgElvishJerricco in fact, why isn't it just stage-2-init? 18:46:30
@k900:0upti.meK900Because WSL explodes if it's a shell script18:47:45
@elvishjerricco:matrix.orgElvishJerriccooof18:48:07
@elvishjerricco:matrix.orgElvishJerricco... so why not just a binary that execs stage-2-init? :P18:48:20
@k900:0upti.meK900And also because WSL really wants to set up its own /dev /proc etc18:48:30
@elvishjerricco:matrix.orgElvishJerriccoah18:48:36
@k900:0upti.meK900I don't really remember all of the stupid things it does18:48:40
@elvishjerricco:matrix.orgElvishJerriccowhich is fair18:48:40
@elvishjerricco:matrix.orgElvishJerricco we shouldn't be doing the special FSes either 18:48:48
@elvishjerricco:matrix.orgElvishJerricco Arian: but yea, I think containers should come with a pre-activated root tree, and starting the container means mounting that tree and the nix store and all that jazz so that systemd can be exec'd as the first PID 1 18:50:55
@k900:0upti.meK900 But yeah if you want to kill stage-2-init, it would be nice to consider the WSL use case 18:51:14
@elvishjerricco:matrix.orgElvishJerriccoIf we could make that work for WSL too, that'd be great18:51:19
@k900:0upti.meK900So we can get rid of our very silly binary 18:51:21
@arianvp:matrix.orgArian

I have a slightly different philosophy in my head still

Systemd is carefully designed to be able to start up without anything but /usr. All early components can get paths to their config in the nix store. Even systemd itself through SYSTEMD_UNITS env var. There is no need for a pre-activated dir. Systemd should be able to boot just fine with just /nix/store (just like it's able to boot with just /usr).

19:25:58
@arianvp:matrix.orgArianAnother problem our repart build doesn't solve yet which is separate from activation is setting up the initial profile. Which is important as all our boot loader builders require there to be a profile19:40:16
@elvishjerricco:matrix.orgElvishJerricco
In reply to @arianvp:matrix.org

I have a slightly different philosophy in my head still

Systemd is carefully designed to be able to start up without anything but /usr. All early components can get paths to their config in the nix store. Even systemd itself through SYSTEMD_UNITS env var. There is no need for a pre-activated dir. Systemd should be able to boot just fine with just /nix/store (just like it's able to boot with just /usr).

I mean setting the SYSTEMD_UNITS env var is still going to be some pre-PID1 setup
20:15:58

Show newer messages


Back to Room ListRoom Version: 6