Thing is, that’s actually pretty good design if you account for all the pros and cons. The reality is most services can tolerate some delay in startup of their dependencies, some even count them in. And if they don’t, that’s what After= is for.
You keep using examples that would benefit from using After= and that’s fine - use After= then. But what if you have nginx service and uwsgi. nginx Requires=uwsgi, but instead of failing if uwsgi is not running, it’s displaying a default page akin to service is currently down or starting up. This way you can get reasonable feedback from your server and sense the status without logging into backend.
Another non-standard example would be to have two services that require each other to work, i.e. they work in tandem. Say my-web-frontend.service and my-web-backend.service. Again, you will probably have some sane fallbacks/warning within the services.
What’s even more crazy, you can specify Requires= and Before= instead of after.
Say you have a backend.service that [email protected] [email protected] [email protected], but needs them started after the main service, so specifies [email protected].
In this case I’m pretty sure (although I didn’t test it) that you can add any number of [email protected] units by the means of systemctl enable, but still require at least N within the main service file.
Again, not the case if you write your unit files correctly. I’m pretty sure you can hurt yourself as well in all the other init/supervisor systems if you do dumb things ![]()
That was to illustrate why you’d use WantedBy=mutli-user.target instead of RequiredBy=multi-user.target. I’m pretty sure failing to reach multi-user.target because of a flaky network connection is a bad idea ![]()
And then you need to add more tooling on top of your system to find out systems are half-broken (like check when a service has died and got restarted too many times, like a counter, or fancy monitoring agents that use more resources than your minimal web server - although at some point, when you manage hundreds of systems like this, a monitoring software becomes kinda mandatory).
You mean like journalctl? xD
Systemd can be pretty verbose with failing services so it’s quite easy to find out which parts are failing and when.