计算机网络/计算机科学与应用/系统/运维/开发

Linux chkconfig 命令

Linux chkconfig 命令

用于检查、设置系统的各种服务

语法:

chkconfig [--add][--del][--list][系统服务]

或者

chkconfig [--level<等级代号>][系统服务][on/off/reset]


参数:

--add 增加所指定的系统服务

--del 删除指定系统服务

--level <等级代号> 指定读系统服务要在哪一个执行等级中开启或关闭

      等级0表示:表示关机

      等级1表示:单用户模式

      等级2表示:无网络连接的多用户命令行模式

      等级3表示:有网络连接的多用户命令行模式

      等级4表示:不可用

      等级5表示:带图形界面的多用户模式

      等级6表示:重新启动


# 列出所有命令

chkconfig --list


# 开启服务

chkconfig http on //开启http服务


# 关闭服务

chkconfig http off //关闭http服务


将编译后的apache开机自启动出现的service httpd does not support chkconfig错误解决方法:

1、vim /etc/init.d/httpd 
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
2、 chkconfig httpd on
3、chkconfig --list


chkconfig

顺,不妄喜;逆,不惶馁;安,不奢逸;危,不惊惧。--史记

评论

^