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


chkconfig 

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

    blob.png

    过滤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 

       blob.png


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

       [root@xwj ~]# chkconfig sshd on

       默认在 2345 级别启动

       blob.png

       设置sshd服务的启动级别

        在345级别上启动

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

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

        blob.png

        只在3级别上启动

        blob.png



猜你喜欢

转载自blog.51cto.com/11193863/2158500