Devlog 2 - DAGs and dependency management
Added arguably the most important part of any service manager, dependencies. Now, when a service depends on another service, it ensures that service is running before continuing. To do this (even though runit does not natively support dependencies), I used DAGs (directed acyclic graphs) to create a dependency tree which errors if there are loops or cycles. This allows the ordering of startup services, which are started in order by the service manager. As a bonus, I factored out some hardcoded services which handle networking and time syncing, so they can be used with any init system. This proved to be harder than anticipated, mostly due to how poorly the original service manager code was written, and most of it had to be refactored, but services are now working flawlessly.
Image: an example dependency tree for a lightweight system. Arrows point in order of startup, and the service manager is started on boot.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.