奇葩的Nginx:nginx.service: Control process exited, code=exited status=203
WEB部署之后,调整Nginx.conf里面的location,多次systemctl restart nginx.service 之后,突然报错,Nginx无法启动。使用systemctl start nginx.service等其他指令也不行。
输入/usr/local/nginx/sbin/nginx -t、/usr/local/nginx/sbin/nginx无反应
[root@localhost system]# systemctl start nginx.service
Warning: The unit file, source configuration file or drop-ins of 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.
systemctl status nginx.service查看显示报错信息
[root@localhost system]# systemctl status nginx.service
● nginx.service - nginx
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2021-03-25 22:19:17 CST; 13s ago
Process: 12265 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=203/EXEC)
Main PID: 10691 (code=exited, status=0/SUCCESS)
3月 25 22:19:17 localhost.localdomain systemd[1]: Starting nginx...
3月 25 22:19:17 localhost.localdomain systemd[1]: nginx.service: Control process exited, code=exited status=203
3月 25 22:19:17 localhost.localdomain systemd[1]: nginx.service: Failed with result 'exit-code'.
3月 25 22:19:17 localhost.localdomain systemd[1]: Failed to start nginx.
复制报错信息,上百度搜,各种方法试遍,还是不行。
认输 ,准备卸载重装Nginx,突然想到直接输入/usr/local/nginx/sbin/nginx为啥没有反应,ls一下发现Y的nginx居然是0字节
[root@localhost sbin]# ls -lrt
总用量 0
-rwxr-xr-x. 1 root root 0 3月 25 20:44 nginx
从别的机器复制一份
[root@localhost sbin]# ls -lrt
总用量 5012
-rwxr-xr-x. 1 root root 5130472 3月 25 2021 nginx
启动nginx,居然可以了,泪奔!搞了2~3个小时,居然是这样解决了问题!
[root@localhost sbin]# systemctl start nginx.service
[root@localhost sbin]# systemctl status nginx.service
● nginx.service - nginx
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-03-25 22:39:01 CST; 9s ago
Process: 12568 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 12569 (nginx)
Tasks: 2 (limit: 820830)
Memory: 1.9M
CGroup: /system.slice/nginx.service
├─12569 nginx: master process /usr/local/nginx/sbin/nginx
└─12570 nginx: worker process
```