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 ...
随机推荐
- 换了SSD发现plank也好了
我的Dock用的是plank,很简单很好用.为什么不用Docky还有其他什么玩意儿呢?plank很简单很好用,资源占用很少,可以智能隐藏,you nearly can't feel it but yo ...
- egrep 正则
首先要记住的是: 正则表达式与通配符不一样,它们表示的含义并不相同!正则表达式只是一种表示法,只要工具支持这种表示法, 那么该工具就可以处理正则表达式的字符串.vim.grep.awk .sed 都支 ...
- SqlServer 将表里面的值赋给变量
@@c_beiz varchar(500) select top 1 @c_beiz = c_beiz from g_billd_qh_tmp where u_id=''+@uid+'' and io ...
- Mysql学习笔记(001)-常见命令
常见命令 SHOW DATABASES; /* use test; create database myemployees; use myemployees; create table employe ...
- leetcode-161周赛-1247-交换字符使得字符串相同
题目描述: 自己的提交: class Solution: def minimumSwap(self, s1: str, s2: str) -> int: count = {"xy&qu ...
- 创建TCP服务器和TCP客户端
import sockethost='127.0.0.1'port=8080web=socket.socket()web.bind((host,port))web.listen(5)# 设置最多连接数 ...
- js获取地址栏的参数
//获取url参数 window.getParam = function(url, id) { url = url+ ""; var regstr = "/(\\?|\\ ...
- PHP ftp_nb_get() 函数
定义和用法 ftp_nb_get() 函数从 FTP 服务器上下载一个文件并保存到本地一个文件中.(无阻塞) 该函数返回下列值之一: FTP_FAILED(发送/获取失败) FTP_FINISHED( ...
- php 空格,换行,跳格使用说明
首先说说\n,\r,\t \n 软回车: 在Windows 中表示换行且回到下一行的最开始位置 在Linux.unix 中只表示换行,但不会回到下一行的开始位置. \r 软空格: 在Linux.uni ...
- java 后台 实现简单的验证码
private int width =80;private int height=30;private Random r=new Random();private String fontnames[] ...