写了脚本,想用命令chkconfig加载自启动.提示"**服务不支持chkconfig",原来是自己写的脚本时,忘记写两行了.开头一般要这样写
#!/bin/bash
#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)
#description:Apache //此行必写,描述服务.
把脚本拷贝至/etc/init.d/目录下,执行命令:
#ln -s /etc/init.d/httpd /etc/rc.d/rc3.d/S61httpd
#ln -s /etc/init.d/httpd /etc/rc.d/rc4.d/S61httpd
#ln -s /etc/init.d/httpd /etc/rc.d/rc5.d/S61httpd
再执行
#chkconfig --levels httpd 345 on
责任编辑:chenqingxiang
来源:
互联网


相关推荐