linux service和chkconfig命令区别

一 .  service  

 1. 使用前提:

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


 2. 服务存在的命令

    service 服务名 

    eg:  service mysql


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管理的服务

           

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

           

              

           chkconfig --del  mysql //删除mysql

          

          chkconfig  --level mysql 2345 on

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

猜你喜欢

转载自blog.csdn.net/mengzuchao/article/details/80284125
今日推荐