23 May 2023 |
@elvishjerricco:matrix.org | There's also a lot of stuff that's down in activation that expects to come before stage 2 systemd | 21:46:46 |
@elvishjerricco:matrix.org | And where is SYSTEMD_UNITS documented? (On my phone at the moment; hard to check) | 21:47:08 |
Arian | You can get a recovery system from stage 2. just systemctl isolate rescue.target | 21:49:11 |
Arian | hmm wait that wont always work if activation fails | 21:49:11 |
Arian | Perhaps we can make it configurable and/or idempotent | 21:49:11 |
Arian | run activation both in stage-1 and stage-2. if it already ran in stage-1 it's a no-op | 21:49:11 |
Arian | Like. nixos-container probably doesn't work anymore once you enabled systemd initrd. which is bad | 21:49:12 |
Arian | We shouldn't break that | 21:49:12 |
@elvishjerricco:matrix.org | Containers already get lots of special treatment | 21:49:46 |
@elvishjerricco:matrix.org | We can just continue that tradition and have a regular init thingy for them | 21:50:04 |
Arian | hmmph maybe. need to give it some thought during sleep | 21:50:43 |
@elvishjerricco:matrix.org | I mean, the more we can kill from activation, the better. Personally I'd like to see it eliminated entirely. But as is, I think the expectation is that it comes before stage 2 | 21:53:09 |
Arian | activation script in the old initrd also doesnt work in nspawn :) (tries to run echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe and fails) | 22:14:29 |
@elvishjerricco:matrix.org | yea I was wondering if that ever worked to begin with :P | 22:15:04 |
Arian | so it's the same amount of broken :) | 22:15:18 |
@elvishjerricco:matrix.org | In reply to @arianvp:matrix.org for systemd units we can use the SYSTEMD_UNITS env var (btw I can't find anything about this environment variable; git grep SYSTEMD_UNITS in the systemd repo comes up blank) | 22:18:18 |
Arian | sorry SYSTEMD_UNIT_PATH | 22:19:11 |
Arian | in man init | 22:19:13 |
@elvishjerricco:matrix.org | ah | 22:19:19 |
Arian | think a lot of things in the activation script we can do with systemd primitives in the future | 22:23:05 |
Arian | systemd-tmpfiles, systemd-sysusers etc | 22:23:13 |
@elvishjerricco:matrix.org | yea | 22:23:18 |
@elvishjerricco:matrix.org | sysusers is a tad tricky because it doesn't do user removal or historical id tracking like we do | 22:23:38 |
@elvishjerricco:matrix.org | but I do want to move that out of activation eventually | 22:23:48 |
Arian | user generation could definitely just be a systemd unit | 22:24:30 |
@elvishjerricco:matrix.org | right | 22:24:36 |
Arian | systemd runs with without /etc/passwd populated | 22:24:39 |
@elvishjerricco:matrix.org | and anything with DefaultDependencies=no that also needs particular users is ordered after systemd-sysusers (at least in systemd's own units) | 22:25:15 |
Arian | user removal is easy with sysusers.d . just remove /etc/passwd and rerun it | 22:27:36 |
Arian | and you can reserve uids with sysusers.d too
r - 500 reserves uid 500
| 22:28:17 |