我遇到過 Nginx 服務隨機失敗的情況,但我不確定原因。
syslog
在執行以下操作時,給了我以下內容cat syslog | grep
:
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Aug 23 00:00:06 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Succeeded.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Start request repeated too quickly.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Aug 23 00:00:07 serv4 logrotate[1506419]: Job for nginx.service failed.
Aug 23 00:00:07 serv4 logrotate[1506419]: See "systemctl status nginx.service" and "journalctl -xe" for details.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Start request repeated too quickly.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Aug 23 00:00:07 serv4 logrotate[1506425]: Job for nginx.service failed.
Aug 23 00:00:07 serv4 logrotate[1506425]: See "systemctl status nginx.service" and "journalctl -xe" for details.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Start request repeated too quickly.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Aug 23 00:00:07 serv4 logrotate[1506430]: Job for nginx.service failed.
Aug 23 00:00:07 serv4 logrotate[1506430]: See "systemctl status nginx.service" and "journalctl -xe" for details.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Start request repeated too quickly.
Aug 23 00:00:07 serv4 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
nginx -t
給了我以下內容:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful