nginx 启动服务是报错

Starting nginx (via systemctl): Warning: nginx.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

解决:

#vim /lib/systemd/system/nginx.service

[Unit]

Description=nginx

After=network.target

[Service]

Type=forking

ExecStart=/usr/local/nginx/sbin/nginx

ExecReload=/usr/local/nginx/sbin/nginx reload

ExecStop=/usr/local/nginx/sbin/nginx quit

PrivateTmp=true

[Install]

WantedBy=multi-user.target

#systemctl enable nginx.service

#pkill -9 nginx

#systemctl start nginx.service

posted @ 2021-03-08 09:44  世界快乐  阅读(890)  评论(0)    收藏  举报