Hacker News new | ask | show | jobs
Circular dependencies for socket activation and WireGuard (rachelbythebay.com)
24 points by asimops 551 days ago
1 comments

I would expect any production-grade software dealing with a dependency graph to have cycle detection. Why doesn't systemd catch this kind of thing and emit a clear error saying "dependency cycle detected in A -> B -> C -> A"? Especially in cases where those dependencies are statically known - it should be able to detect this problem even before starting the services. Is there something I'm missing here? Are there any cases where a cyclical dependency is a legitimate requirement?
Systemd does detect and log cycles and breaks them by arbitrarily removing one dependency.

Thought in this case there is an invisible (to systemd) dependency where a service depends on a network interface, but that interface is created by an arbitrary other service.

So you have to manually create a dependency between these services to make it visible.