!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

618 Members
NixOS ❤️ systemd173 Servers

Load older messages


SenderMessageTime
23 Mar 2025
@elvishjerricco:matrix.orgElvishJerriccoI have not made as much time as I usually do for nixos stuff since 24.11, so systemd by default in 25.05 is unlikely, again :(23:44:41
@elvishjerricco:matrix.orgElvishJerriccoplus I've been sidetracked by a couple other nixos things like the ISO23:45:08
@antifuchs:asf.computerantifuchsunderstandable yet sad23:45:13
@antifuchs:asf.computerantifuchsno worries, I'm gonna figure this out one way or the other23:45:24
@antifuchs:asf.computerantifuchs

can you think of a good way to halt the boot process in scripted initrd until a condition is met? I have been trying

              boot.initrd.preLVMCommands = ''
                while ! [ -f /tmp/fnord ] ; do
                  sleep 1
                done
              '';

and it sure seems to stop the boot but you don't get output from the machine in case anything goes wrong...

23:46:42
@elvishjerricco:matrix.orgElvishJerriccoyea that's, uh... a good use case for systemd initrd :P23:48:41
@uep:matrix.orguep

random idle musing: what's the right way to express dependencies between services, that says service A needs to be running, but should also be restarted whenever service B starts or stops?

Use case:

  • Service A: smartd, which either doesn't notice new disks arriving, or gets very upsetti when they go offline
  • Service B: something that's going to power on/off and zpool import an external chassis with 36 disks in a backup pool, to be triggered by other conditions
23:50:32
@uep:matrix.orguep *

random idle musing: what's the right way to express dependencies between services, that says service A needs to be running, but should also be restarted whenever service B starts or stops?

Use case:

  • Service A: smartd, which either doesn't notice new disks arriving, or gets very upsetti when they go offline
  • Service B: something that's going to power on/off and zpool import an external chassis with 36 disks in a backup pool, to be triggered by other conditions
23:50:39
@uep:matrix.orguep(B might get split into separate power state and import state units, but that's not really important for this question. I want to restart smartd around the disks either arriving or leaving23:52:17
@uep:matrix.orguep* (B might get split into separate power state and import state units, but that's not really important for this question. I want to restart smartd around the disks either arriving or leaving)23:52:21
@elvishjerricco:matrix.orgElvishJerricco uep: I wonder if that's more of a job for udev 23:54:36
@elvishjerricco:matrix.orgElvishJerricco * uep: I wonder if that's more of a job for udev rules 23:54:49
@uep:matrix.orguepmaybe23:54:51
@uep:matrix.orguepit might also just be better smartd configuration23:55:00
@uep:matrix.orguepbut that's a question for somewhere else, so I asked this one here ;-)23:55:29
@elvishjerricco:matrix.orgElvishJerricco there's StopPropagatedFrom= / PropagatesStopTo= to propagate stops from one unit to another 23:56:42
@elvishjerricco:matrix.orgElvishJerriccobut that's not a restart23:56:46
@uep:matrix.orguep(my initial guess about udev rules was that it might be hard to avoid restarting smartd 36 times)23:58:17
@elvishjerricco:matrix.orgElvishJerricco yea you'd have to use the right udev rule. 23:58:41
@elvishjerricco:matrix.orgElvishJerriccoeither something that can detect the completed state23:58:49
@elvishjerricco:matrix.orgElvishJerriccoor starting a systemd timer that waits an appropriate amount of time23:58:59
24 Mar 2025
@uep:matrix.orguepit might end up being timers anyway, because i don't want it to try counting to 36 and then only 35 disks appear one day 00:00:13
@elvishjerricco:matrix.orgElvishJerriccoyea you'd really want to detect at the chassis level "all disks inside are powered up", not "36 disks are powered up"00:00:46
@elvishjerricco:matrix.orgElvishJerriccothat may or may not be possible00:00:59
@elvishjerricco:matrix.orgElvishJerricco oh but you could combine this with Upholds 00:01:11
@uep:matrix.orguep(same problem with just picking one particular disk as the trigger, but i could possibly trigger on the controller / sas expander / chassis ses device or something like that)00:01:21
@elvishjerricco:matrix.orgElvishJerriccohm but you still have to deal with restarting when the other unit is started00:01:30
@elvishjerricco:matrix.orgElvishJerriccoyea, I'm thinking that you will either need to learn how to identify the state of the chassis as a whole, or otherwise just start a systemd timer to restart the service whenever any of the disks appears or disappears00:02:31
@uep:matrix.orguepat least then it's a different transaction00:03:06
@elvishjerricco:matrix.orgElvishJerriccothe nice thing about a timer is that starting it 36 times will still only cause it to elapse once00:03:32

Show newer messages


Back to Room ListRoom Version: 6