chkconfig命令

主要用来更新(启动或停止)和查询系统服务(service)的运行级信息,用于维护/etc/rc[0-6].d目录的命令行工具。

chkconfig -–add httpd
增加httpd服务 chkconfig –-del httpd
删除httpd服务 chkconfig –-list
列出系统所有的服务启动情况 chkconfig –-list mysqld
列出mysqld服务设置情况 chkconfig –-level 35 mysqld on
设定mysqld在等级3和5为开机运行服务(on表示开机启动,off表示开机不启动,reset指重置服务的启动信息) chkconfig mysqld on
设定mysqld在各等级为on,“各等级”包括2、3、4、5等级 等级0表示:表示关机
等级1表示:单用户模式
等级2表示:无网络连接的多用户命令行模式
等级3表示:有网络连接的多用户命令行模式
等级4表示:不可用
等级5表示:带图形界面的多用户模式
等级6表示:重新启动

systemctl(代替chkconfig和service)

在 Centos 中 systemctl 是设置系统服务(service)的命令,它融合之前service和chkconfig的功能于一体。
可以使用它永久性或只在当前会话中启用/禁用服务。 启动、停止、重启、重载服务 systemctl start name.service systemctl stop name.service systemctl restart name.service systemctl reload name.service 查看某个服务(单元)的状态
systemctl status name.service 激活/禁止自动启动
systemctl enable httpd.service
systemctl disable httpd.service 杀死服务
systemctl kill httpd

chkconfig 和 systemctl 区别对比

任务 旧指令 新指令
使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service
检查服务状态 service httpd status systemctl status httpd.service(服务详细信息) / systemctl is-active httpd.service (仅显示是否 Active)
加入自定义服务 chkconfig --add test systemctl load test.service
删除服务 chkconfig --del xxx 停掉应用,删除相应的配置文件
显示所有已启动的服务 chkconfig --list systemctl list-units --type=service
启动某服务 service httpd start systemctl start httpd.service
停止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service

chkconfig 与 systemctl的更多相关文章

  1. Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)

    之前在Linux centos 7 上安装了apache 和mysql,当时并没有设置开机自动启动. 最近又重新练习网页,每次开机总是要手动启动httpd和mysqld,不方便,就想设置成开机自动启动 ...

  2. Centos7 环境下开机 自启动服务(service) 设置的改变 (命令systemctl 和 chkconfig用法区别比较)

    参考文章:  <Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)> http://blog.csdn.net/kenhins/article/ ...

  3. 更新换代----systemctl命令取代chkconfig和service

    systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 ...

  4. 对比centos7的systemctl和其他service+chkconfig

    syetemctl就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了.systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig ...

  5. systemctl命令

    systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 ...

  6. systemctl 命令的用法

    对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.serv ...

  7. systemctl

      旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service 使某服务不自动启动 chkconfig - ...

  8. CentOS7 service/chkconfig replace commands

    对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.serv ...

  9. 服务管理--systemctl命令

    摘要: systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level ...

随机推荐

  1. vue eslint修改为4个空格

  2. Docker 部署 nginx 前端项目

    docker pull nginx docker run -itd -p 82:80 -v /opt/soft/nginx/conf/nginx.conf:/etc/nginx/nginx.conf ...

  3. 多媒体查询 @media 报错

    You may not @extend an outer selector from within @media.You may only @extend selectors within the s ...

  4. hive UDAF开发和运行全过程

    介绍 hive的用户自定义聚合函数(UDAF)是一个很好的功能,集成了先进的数据处理.hive有两种UDAF:简单和通用.顾名思义,简单的UDAF,写的相当简单的,但因为使用Java反射导致性能损失, ...

  5. (转)Vmware vSphere 5.0系列教程 vSphere网络原理及vSwitch简介 及一个host两个网卡说明

    转:http://andygao.blog.51cto.com/323260/817518/ 在一个物理网络拓扑中,通常都是路由器-交换机-PC机的连接,不同的服务器和PC机,通过交换机的连接而相互连 ...

  6. AutoCAD2016简体中文破解版32位64位下载

    AutoCAD2016序列号:666-69696969 667-98989898 400-45454545 066-66666666(任意一个) AutoCAD2016产品密钥:001H1 AutoC ...

  7. Codeforces 340B - Maximal Area Quadrilateral (计算几何)

    Codeforces Round #198 (Div. 2) 题目链接:Maximal Area Quadrilateral Iahub has drawn a set of \(n\) points ...

  8. CUDA编程之环境配置

    VS2015+CUDA8.0环境配置 Anyway,在这里记录下正确的配置方式: 1.首先,上官网下载对应vs版本的CUDA toolkit: https://developer.nvidia.com ...

  9. 6-vim-移动命令-01-方向和行内移动

    移动 命令模式下快速移动光标 编辑操作命令与移动命令结合使用 1.上下左右 命令 功能 手指 h 向左 食指 j 向下 食指 k 向上 中指 l 向右 无名指 2.行内移动 命令 英文 功能 w wo ...

  10. 几何问题 poj 1408

    参考博客: 用向量积求线段焦点证明: 首先,我们设 (AD向量 × AC向量) 为 multi(ADC) : 那么 S三角形ADC = multi(ADC)/2 . 由三角形DPD1 与 三角形CPC ...