Last active
December 19, 2015 00:18
-
-
Save visamz/5867321 to your computer and use it in GitHub Desktop.
centOS chkconfig 使用
原文:http://www.cnblogs.com/gzrhappy/articles/2220868.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
安装centOS 后 某些服务不是自动启动 | |
chkconfig 可以检查和 设置服务自动启动 | |
#chkconfig --list | |
输出 所有服务列表 | |
如果列表中没有你要启动的服务 | |
可以使用 | |
#chkconfig --add 添加进去: | |
#chkconfig --add postfix | |
删除自然就是 | |
#chkconfig --del 添加进去: | |
#chkconfig --del postfix | |
--list 后面可以加 服务名称 就只输出此服务的信息 | |
例如 | |
#chkconfig --list httpd | |
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off | |
上面的输出 0-6 都为off 时 表示 没有自动启动 | |
0-6 分别表示的是 | |
等级0表示:表示关机 | |
等级1表示:单用户模式 | |
等级2表示:无网络连接的多用户命令行模式 | |
等级3表示:有网络连接的多用户命令行模式 | |
等级4表示:不可用 | |
等级5表示:带图形界面的多用户模式 | |
等级6表示:重新启动 | |
#chkconfig httpd on | |
就可以把httpd服务 设置为自动启动了 | |
再次查看 | |
#chkconfig --list httpd | |
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off | |
这个时候2~5都是on,设置成功。 | |
相反的 | |
#chkconfig httpd off 就是 关闭自动启动 | |
最后 还有个 --level 应该是对 0-6 某些 等级进行单独设置 | |
#chkconfig --level 35 httpd on 将3和5 设置成on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment