chkconfig 

    chkconfig --list 查看所有服务对应的运行级别

    题目:命令chkconfig;开机自启动服务_开机

    过滤3级别开机自动启动的服务

    [root@xwj ~]# chkconfig --list | grep "3:on"

    查看某个服务开机自启级别,例如查看 iptables 

    [root@xwj ~]# chkconfig --list iptables





开机自启动服务:sshd 

一、更改配置文件

       将启动命令放入  /etc/rc.local

       例如配置sshd服务开机自启动: 

       [root@xwj ~]# echo /etc/init.d/sshd start >>/etc/rc.local 

       题目:命令chkconfig;开机自启动服务_初学者_02


二、使用chkconfig命令管理开机自启动

       [root@xwj ~]# chkconfig sshd on

       默认在 2345 级别启动

       题目:命令chkconfig;开机自启动服务_Linux_03

       设置sshd服务的启动级别

        在345级别上启动

        [root@xwj ~]# chkconfig sshd on --level 345

        [root@xwj ~]# chkconfig --level 345 sshd on 

        题目:命令chkconfig;开机自启动服务_初学者_04

        只在3级别上启动

        题目:命令chkconfig;开机自启动服务_初学者_05