A service keeps crashing and systemd stops restarting it after a few attempts. How do you tune this?
IntermediateScenarioProcesses, services and systemd
Answer
Situation read → Start rate limiting is kicking in.
What I'd do →
- Look:
systemctl status appshows "Start request repeated too quickly". - Find the cause in
journalctl -u app -b. - Tune if appropriate:
[Unit]
StartLimitIntervalSec=300
StartLimitBurst=10
[Service]
Restart=on-failure
RestartSec=10
- Reset after fixing:
systemctl reset-failed app.
Why → Rate limiting prevents a crash loop from burning CPU. Tuning gives transient issues time to clear, but it doesn't hide real bugs.
Interview tip → Mention that StartLimit* belongs in [Unit] on current systemd.
More on Processes, services and systemd
Your team has a Python API that someone starts with `nohup python app.py &`. Make it a proper service running as a non-root user.BeginnerThe service you created must bind to port 443, but it runs as a non-root user. How?BeginnerYou need to change one setting (memory limit) in a vendor-supplied unit file without editing it. How?BeginnerA service depends on a database on the same host and fails at boot because the DB isn't ready. How do you fix the ordering?IntermediateA long-running app must reload its config without dropping connections. How do you wire this into systemd?IntermediateA script needs to run once at boot after networking, then exit. How do you do it with systemd?Beginner