问题库 Linux / Docker how-to

systemctl 如何查看服务状态

快速答案

systemctl status 看摘要,journalctl -u 看完整日志。

bash
systemctl status nginx
journalctl -u nginx --since "1 hour ago"

使用要点

  • 先执行只读命令确认现象,再决定是否修改配置。
  • 线上执行前保存当前输出,便于回滚和对比。

相关内容