奇葩的Nginx:nginx.service: Control process exited, code=exited status=203

在WEB部署后修改Nginx配置并尝试重启服务时,遇到Nginx启动失败的问题,报错信息显示控制进程退出状态为203。尝试多种解决方案无效,发现/usr/local/nginx/sbin/nginx文件大小为0字节。从其他机器复制正常文件替换后,Nginx成功启动。问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

奇葩的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)
325 22:19:17 localhost.localdomain systemd[1]: Starting nginx...
325 22:19:17 localhost.localdomain systemd[1]: nginx.service: Control process exited, code=exited status=203
325 22:19:17 localhost.localdomain systemd[1]: nginx.service: Failed with result 'exit-code'.
325 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 325 20:44 nginx

从别的机器复制一份

[root@localhost sbin]# ls -lrt
总用量 5012
-rwxr-xr-x. 1 root root 5130472 325 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
           ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值