VPS侦探论坛

 找回密码
 注册
查看: 3094|回复: 3

nginx 的启动问题

[复制链接]
发表于 2019-3-12 17:23:28 | 显示全部楼层 |阅读模式

今天在一台全新的centos 7上通过lnmp 1.6 只安装nginx

安装完毕时,系统显示:
Starting nginx... /etc/init.d/nginx: line 36: /bin/netstat: No such file or directory
done


在Centos 7上,netstats 已经被iproute2 代替了,也就是ss

我看了一下/etc/init.d/nginx的文件,发现25-29行为:

if [ -s /bin/ss ]; then

    StatBin=/bin/ss

else

    StatBin=/bin/netstat

fi



默认的Centos 7是没有netstat的, ss 的默认路径是/usr/sbin/ss,所以会出现这两个文件都找不到的错误
但是在我其他的安装了lnmp的机器上确没有发现这个问题,我估计可能是如果安装lnmp的全部组件,会把net-tools安装上?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-3-12 17:24:49 | 显示全部楼层


代码乱码了。。25-29行是这样的:


if [ -s /bin/ss ]; then
    StatBin=/bin/ss
else
    StatBin=/bin/netstat
fi
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2019-3-13 08:43:55 | 显示全部楼层

收到,启动脚本会进行重写
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-3-16 17:27:11 | 显示全部楼层



谢军哥,我看到已经更新了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 01:19 , Processed in 0.026798 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表