Hacker News new | ask | show | jobs
by secabeen 3446 days ago
I've never particularly liked init systems that restart jobs when they die. Normally, I don't want daemons that crash to restart. They should die, be caught by monitoring and the server bypassed. I would accept a single restart but after that, there's clearly a problem, and the systems should fail, rather than restarting the process again and again and again.
1 comments

As a single user with a number of personal/hobbyist machines, I actually find systemd annoying to work with for precisely this reason. If a daemon is misconfigured and fails to launch several times in a row, it inevitably triggers the systemd "too many retries" error, after which systemd will refuse to start the daemon until some timeout has expired or the counter is cleared. This makes troubleshooting more difficult and frustrating.
Funnily enough, just dealt with a bug caused by this at work. The small PC would boot before the cellular modem had an Internet connection. Services that communicate via MQTT would immediately attempt to reach the broker, and throw an exception. My quick fix was just to add "RestartSec=5" so that the faulted state would never be entered.
Ironic considering how systemd developers brag about eliminating race conditions and sleep calls from init scripts.