linux service和chkconfig命令区别

一 .  service  

 1. 使用前提:

     /ect/init.d/服务名  脚本存在

linux service和chkconfig命令区别

 2. 服务存在的命令

    service 服务名 

    eg:  service mysql

linux service和chkconfig命令区别

3. 管理服务(启动,重启,停止) 

    service mysql start   // 启动mysql,  与 /etc/init.d/mysql start 功能一样

    service mysql restart  //重启mysql  

    service mysql status  //查看mysql状态

     service --status-all  //查看所有服务的状态

二. chkconfig

    1. 使用前提

           /ect/init.d/服务名  脚本存在

    2. 管理系统服务在不同运行级别启动与停止的工具

          chkconfig --list  //显示所有被chkconfig管理的服务

           linux service和chkconfig命令区别

          chkconfig --add mysql  //添加mysql   ->其实是在不同的运行级别下添加启动与停止的符号链接

           linux service和chkconfig命令区别

           linux service和chkconfig命令区别   

           chkconfig --del  mysql //删除mysql

          linux service和chkconfig命令区别

          chkconfig  --level mysql 2345 on

   参考:http://man.linuxde.net/chkconfig