monome / norns-image

79 stars 16 forks source link

hard dependencies for systemd units #44

Closed artfwo closed 5 years ago

artfwo commented 6 years ago

systemd units should have explicit (Requires) dependencies as illustrated below:

norns.target should explicitly require all of the above.

simonvanderveldt commented 6 years ago

Shouldn't norns-crone have a dependency on norns-jack that ensures norns-crone only runs when norns-jack is running? And the same for norns-maiden vs norns-matron?

artfwo commented 6 years ago

Sure, I kind of tried to reflect that in the nested structure of the list above. Inner items depend on parent items.

artfwo commented 6 years ago

Also, maiden doesn't require either crone or matron to run, so it can be started independently after network.target.

simonvanderveldt commented 6 years ago

Sure, I kind of tried to reflect that in the nested structure of the list above. Inner items depend on parent items.

Sorry, my reply wasn't very clear/explit. AFAIK Requires doesn't handle the case where the required unit fails.

From https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=

Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running

In our case I think we have a couple of services that can no longer function when their dependency dies.

artfwo commented 6 years ago

That would be awesome, but I cannot setup reliable monitoring for jackd at the moment (and its tools such as jack_wait also have false negatives), so I'd like to at least make sure it triggers a restart of crone when restarted.

simonvanderveldt commented 5 years ago

@artfwo I think this is all done at the moment, right?

artfwo commented 5 years ago

@simonvanderveldt yes, looks like it!