systemd 启动频率限制导致服务起不来的定位
systemctl start app 失败,systemctl status app 显示 start request repeated too quickly 或 start-limit-hit。服务可能短暂启动后反复崩溃,最终被 systemd 锁定。
systemctl status app
journalctl -u app --since '10 min ago'
systemctl show app -p StartLimitIntervalSec -p StartLimitBurst -p Restart
systemctl show app -p ExecStart -p User -p WorkingDirectory
systemctl reset-failed app
ExecStart 路径、参数或运行用户错误。Restart=always 放大崩溃循环。StartLimitIntervalSec/StartLimitBurst 设置过严。ExecStart 命令,确认能正常启动。RestartSec、StartLimitIntervalSec、StartLimitBurst。systemctl daemon-reload,再 reset-failed 并启动。Restart=on-failure 替代 always,避免无意义重启。systemctl — 服务管理journalctl — 启动日志systemd-analyze — 启动分析