为了便于管理linux服务器上的服务,很多人都喜欢用service nginx start这样的方式来管理,也就是系统服务吧
这样可以设置自动启动

chkconfig --level 35 nginx on
service nginx start|stop|status|reload
 

编译安装的软件服务脚本多位于/usr/local/sbin  目录下,例如

cp /usr/local/sbin/rc.radiusd /etc/init.d/radius
 

等命令

那么很多时候我们在制作完脚本后吧他拷贝到/etc/init.d后用chkconfig --add nginx的时候出现诸如下面的错误

service xxxx does not support chkconfig
 

那解决方法如下:
在脚本的开头添加下面两行即可:

#chkconfig: - 85 15
#description: nginx is a World Wide Web server. It is used to serve
 

井号不要去掉。

服务不支持 chkconfig,另外还有一个非常重要的原因
就是可执行权限

chmod +x /etc/init.d/php-fpm



https://blog.51cto.com/professor/1579791