How I’d like my init system / service supervisor to be

14 points by runxiyu


FRIGN

I like the outline of design criteria to sketch a better overall system. Really helpful would be an assessment of existing solutions, e.g. runit and, of course, OpenRC and systemd.

KayodeLycaon

Interesting. You don't control services, you control states. You can't turn something on or off, you can only create a state where it is on or off. I really like the intention of this, but it would need to be the right implementation.

Speaking hypothetically and assuming my assumption is correct:

You can't stop something like a firewall unless you've created a state where the firewall is off. And if you created a rule that the network should be down if the firewall is off, you have no state where you can turn the firewall off and still have network access, unless you create a state with that dependency tree.

Effectively this system rigidly locks what state the system can be in. If you didn't create the state you need ahead of time, you have to create one, while accounting for any dependencies of all other states.

This creates a lot of incentive to bypass the supervisior, either by using things like monit, running services without supervision, or creating states for each individual services without specifying dependencies.

But, you can mitigate this by having an option on a service that creates an associated state without the user having to explicitly make one. (Call it independent control, which explains why other services have it off.) The services that come with the operating system wouldn't use this feature, because you know what states the user is likely to need. These defaults will nudge users in the correct direction.

Users are already going to try to work around the enforced structure of states. Instead of making them take extra steps, make it a feature. This doesn't require any compromises to the design of the system. Turning this option on for the system firewall won't be useful. If the network requires the firewall to be active, a firewall state cannot disable it.

sugaryboa

I think that building an init system on the concept of dependencies is a mistake.

Services might, of course, require certain other services to function correctly, but a malfunction of one service must not bring the system down.

In other words, there the init should not deal with dependencies, it should start all services at the same time, and the services that cannot start at the moment shall report that and be restarted after a short delay, until finally starting successfully.