码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-08-12 20:02:20      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:lob   技术分享   自动启动   init.d   images   cal   orm   img   微软   


chkconfig 

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

    技术分享图片

    过滤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命令管理开机自启动

       [root@xwj ~]# chkconfig sshd on

       默认在 2345 级别启动

       技术分享图片

       设置sshd服务的启动级别

        在345级别上启动

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

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

        技术分享图片

        只在3级别上启动

        技术分享图片



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

标签:lob   技术分享   自动启动   init.d   images   cal   orm   img   微软   

原文地址:http://blog.51cto.com/11193863/2158500

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!