chkconfig 服务

上一篇 / 下一篇  2011-06-21 22:15:31 / 个人分类:Linux

Linux查看服务的启动状态,并且启动和停止服务的方法

#查看服务在每个级别的运行状态
[root@localhost ~]#chkconfig --list
httpd0:off 1:off 2:off 3:off 4:off 5:on 6:off
bluetooth0:off 1:off 2:off 3:off 4:off 5:off 6:off

#停止httpd服务
[root@localhost ~]# service httpd stop
Stopping httpd:[ OK ]

#启动httpd服务
[root@localhost ~]# service httpd start
Starting httpd:[ OK ]

#重起httpd服务
[root@localhost ~]# service httpd restart
Stopping httpd:[ OK ]
Starting httpd:[ OK ]

#让httpd在机器启动的时候在运行级别上停止
[root@localhost ~]# chkconfig --level 345 httpd off
[root@localhost ~]# chkconfig --list |grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

#让httpd在机器启动的时候在运行级别上启动
[root@localhost ~]# chkconfig --level 345 httpd on
[root@localhost ~]# chkconfig --list |grep httpd
httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off


TAG:

 

评分:0

我来说两句

Open Toolbar