Stop systemd from being too clever with unit dependencies
Technical Briefing | 9/25/2026
We have all been there. You define a hard dependency between services, trigger a reboot, and watch the entire startup sequence hang because one unit decided it needed to wait for an optional dependency that was never going to come online. You see systemd sitting there, stubbornly refusing to start your app because a secondary sidecar service is stuck in a loop. It is frustrating, especially when the main process could have been handling traffic just fine on its own.
When Requires turns into a trap
Most sysadmins reflexively reach for Requires= or Wants= without checking if their service actually needs that dependency to function. If you put Requires= in your unit file, you are telling the init system that your service cannot exist without the other one. If the dependency dies, your service goes down with it. That is often the opposite of what you want for logging shippers or health check agents that really ought to be fire-and-forget.
systemctl list-dependencies --after your-app.service
- Use After= for ordering without creating a hard dependency link
- Switch to Wants= if you want the service to start but not crash the main app if it fails
- Add PartOf= if you specifically need the dependent service to stop when your app stops
- Check systemd-analyze critical-chain to see exactly which unit is causing the bottleneck
Break the cycle before it bites you
If you find that your service is getting stuck in a start-up loop because of a remote mount or a network-dependent service, start stripping out the Requires lines. If the app can retry the connection, let the app do it. Stop making systemd the arbiter of your application’s internal network state. You will find that your boot times speed up significantly and those phantom hangs during updates start to disappear for good.
