monome / norns-image

79 stars 16 forks source link

How are we going to keep the required processes running? #29

Closed simonvanderveldt closed 6 years ago

simonvanderveldt commented 6 years ago

This has been bugging me for a while so I figured I should create an issue for it.

I'm wondering how we're going to keep the necessary processes running. And what should happen in case any of them crashes or hangs but doesn't crash? Do we have any idea about how we want to handle this?

This is mainly triggered by the fact that supercollider (or more specifically sclang) doesn't really seem to be made for running in the background, see https://github.com/supercollider/supercollider/issues/2655.

As far as I know we have the following components that need to be running, if I missed anything please let me know :)

We also have ws-wrapper, which would wrap sclang/crone and matron. I haven't looked into it's internals but does this properly handle/pass signals? Does it reap zombie (sub)processes? And what happens when ws-wrapper itself dies?

Since these are all effectively daemons for our purposes normally they would be executed as a daemon by some process supervisor that can guarantee that when it dies it will be restarted. We currently don't have one yet on the buildroot image so we'll need to pick one if we choose to go this way. But that does mean the components need to be able to run as a daemon which currently isn't really the case.

artfwo commented 6 years ago

My 2 cents: we don't have to run norns components as proper daemons. A basic supervisor that watches for subprocesses until they shutdown will cover 99% of use cases.

sclang shouldn't be run as daemon either, since we need to interact with it via standard i/o (as maiden does via ws-wrapper) to be able to write supercollider code on the system.

artfwo commented 6 years ago

guess this is now pretty much covered by systemd?

simonvanderveldt commented 6 years ago

Yep :)