chkconfig 与 systemctl
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的更多相关文章
- Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)
之前在Linux centos 7 上安装了apache 和mysql,当时并没有设置开机自动启动. 最近又重新练习网页,每次开机总是要手动启动httpd和mysqld,不方便,就想设置成开机自动启动 ...
- Centos7 环境下开机 自启动服务(service) 设置的改变 (命令systemctl 和 chkconfig用法区别比较)
参考文章: <Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)> http://blog.csdn.net/kenhins/article/ ...
- 更新换代----systemctl命令取代chkconfig和service
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 ...
- 对比centos7的systemctl和其他service+chkconfig
syetemctl就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了.systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig ...
- systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 ...
- systemctl 命令的用法
对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.serv ...
- systemctl
旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service 使某服务不自动启动 chkconfig - ...
- CentOS7 service/chkconfig replace commands
对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.serv ...
- 服务管理--systemctl命令
摘要: systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 任务 旧指令 新指令 使某服务自动启动 chkconfig --level ...
随机推荐
- 【CSS】三栏布局的经典实现
要求:自适应宽度,左右两栏固定宽度,中间栏优先加载: <!DOCTYPE html> <html> <head> <title>layout</t ...
- Delphi 类(TObject、TPersistent、TComponent、TControl、TWinControl、TCustomControl、TGraphicControl、TInterfacedObject)简单介绍
TObject: VCL中所有类的根类,即是说:VCL中所有的类/组件/控件都是从TObject中继承而来.TObject类中定义了基本的 构造方法和析构方法. TPersistent: ...
- Nginx配置PHP环境支持
打开Nginx配置文件 输入 vim etc/nginx/nginx.conf 找到配置扩展文件: 打开配置文件配置如下环境: server { listen 80; server_nam ...
- Android中的Service 与 Thread 的区别
很多时候,你可能会问,为什么要用 Service,而不用 Thread 呢,因为用 Thread 是很方便的,比起 Service 也方便多了,下面我详细的来解释一下. 1). Thread:Thre ...
- 机器学习技法笔记:Homework #5 特征变换&Soft-Margin SVM相关习题
原文地址:https://www.jianshu.com/p/6bf801bdc644 特征变换 问题描述 程序实现 # coding: utf-8 import numpy as np from c ...
- Netty 源码分析——ChannelPipeline
Netty 源码分析--ChannelPipeline 通过前面的两章我们分析了客户端和服务端的流程代码,其中在初始化 Channel 的时候一定会看到一个 ChannelPipeline.所以在 N ...
- JUC源码分析-集合篇(一)ConcurrentHashMap
JUC源码分析-集合篇(一)ConcurrentHashMap 1. 概述 <HashMap 源码详细分析(JDK1.8)>:https://segmentfault.com/a/1190 ...
- python-selenium -- 弹出框处理
弹出框有两种:页面弹出框(可定位元素能操作).Windows弹出框(不能直接定位) 一.页面弹出框 等待弹出框出现之后,定位弹出框,操作其中元素 如: driver = webdriver.Chrom ...
- 4-Ubuntu-启动/关闭/重启mysql服务
启动: sudo service mysql start 关闭: sudo service mysql stop 重启: sudo service mysql restart
- poj 1905 图形推算+二分
参考博客: 题意: 一根两端固定在两面墙上的杆 受热弯曲后变弯曲 求前后两个状态的杆的中点位置的距离 分析:见博客 代码: #include<stdio.h> #include<io ...