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,避免无意义重启。合上页面,先回答,再展开对照。
start-limit-hit / start request repeated too quickly 是什么含义?Restart= 应如何选择?ExecStart 命令确认能正常启动;还要检查运行用户、工作目录、环境变量和文件权限。systemctl daemon-reload,再 reset-failed 并启动;必要时调整 RestartSec、StartLimitIntervalSec、StartLimitBurst,并可用 Restart=on-failure 替代 always。
小程序版
微信扫码,随时查命令