Centos 7 主要命令改动 service chkconfig iptables
1.service、chkconfig => systemctl
seivice和chkconfig 是linux上的常用命令在centos7上被systemctl代替。
CentOS 7 使用systemd替换了SysV。Systemd目的是要取代Unix时代以来一直在使用的init系统,兼容SysV和LSB的启动脚本,而且够在进程启动过程中更有效地引导加载服务。
systemd的特性有:
- 支持并行化任务;
- 同时采用socket式与D-Bus总线式激活服务;
- 按需启动守护进程(daemon);
- 利用 Linux 的 cgroups 监视进程;
- 支持快照和系统恢复;
- 维护挂载点和自动挂载点;
- 各服务间基于依赖关系进行精密控制。
我们对service和chkconfig两个命令都不陌生,systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。
systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable xxx.service #开机运行服务
systemctl disable xxx.service #取消开机运行
systemctl start xxx.service #启动服务
systemctl stop xxx.service #停止服务
systemctl restart xxx.service #重启服务
systemctl reload xxx.service #重新加载服务配置文件
systemctl status xxx.service #查询服务运行状态
systemctl --failed #显示启动失败的服务
注:xxx代表某个服务的名字,如http的服务名为httpd
例如在CentOS 7
启动服务(等同于service httpd start)
systemctl start httpd.service
停止服务(等同于service httpd stop)
systemctl stop httpd.service
重启服务(等同于service httpd restart)
systemctl restart httpd.service
查看服务是否运行(等同于service httpd status)
systemctl status httpd.service
开机自启动服务(等同于chkconfig httpd on)
systemctl enable httpd.service
开机时禁用服务(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服务是否开机启动 (等同于chkconfig --list)
systemctl is-enabled httpd.service
2. iptables=>firewall
一些重要的服务 centos7 也做了修改 例如 iptables
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
以往的centos使用的文件系统是 ext2/ext3/ext4
CentOS7.0的默认文件系统类型是Xfs
其对应的调整命令是 xfs_growfs
不同文件系统类型对应的创建、检查、调整命令不同,要注意区分。
ip addr
Centos 7 主要命令改动 service chkconfig iptables的更多相关文章
- Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.service not loaded.
背景: 测试部署NetCore 项目到linux 系统时,窗口显示项目部署成功:但是本机无法访问(linux 在虚拟机上[ centos 7.6] ); 如下图↓ 能够相互ping 通,(Xshe ...
- Centos7下的systemctl命令与service和chkconfig
博主使用的操作系统是最新的CentOS 7,所以可能和网上一些老的博文有一定出入,那是因为版本更新的原因. 这里写图片描述1 service service命令用于对系统服务进行管理,比如启动(sta ...
- Centos7 环境下开机 自启动服务(service) 设置的改变 (命令systemctl 和 chkconfig用法区别比较)
参考文章: <Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)> http://blog.csdn.net/kenhins/article/ ...
- CentOS 7 防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load
错误信息如下: [root]# service iptables start Redirecting to /bin/systemctl start iptables.service Failed t ...
- centos 的系统管理命令 service systemctl
centos 的 systemctl 命令 systemctl is-enabled *.service #查询服务是否开机启动 systemctl enable *.service # ...
- (转)CentOS 7.0关闭默认防火墙启用iptables防火墙
场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...
- CentOS 7.0关闭默认防火墙启用iptables防火墙
转自:https://www.cnblogs.com/lixuwu/p/6087023.html 阅读目录 1 配置防火墙,开启80端口.3306端口 2 关闭SELINUX 3 CentOS 配置防 ...
- Linux下 CentOS 7 对比6 改动详解 及 系统安装
系统基础服务变化 操作系统 本文CentOS7 为最新版7.5 本文CentOS6 为6.9 操作 Centos6 Centos7 对比 自动补全 只支持命令.文件名 支持命令.选项.文件名 文件系统 ...
- Failed to stop iptables.service: Unit iptables.service not loaded.解决方法
CentOS7中执行 service iptables start/stop 会报错Failed to start iptables.service: Unit iptables.service fa ...
随机推荐
- cogs 1829. [Tyvj 1728]普通平衡树 权值线段树
1829. [Tyvj 1728]普通平衡树 ★★★ 输入文件:phs.in 输出文件:phs.out 简单对比时间限制:1 s 内存限制:1000 MB [题目描述] 您需要写一种数 ...
- play framework 相关
1.下载 官网下载解压,安装有jkd即可使用 2.helloworld $ activator new my-first-app play-java https://www.playframework ...
- crawler 听课笔记 碎碎念 2 一些爬虫须知的基本常识和流程
html的宗旨: <标签 属性=”属性的值“></标签> 只是对于文本的一种解释划分吧 dom的宗旨: 就是一个大数组,处理方便,效率低 xm ...
- AVR单片机教程——蜂鸣器
本文隶属于AVR单片机教程系列. 引子 定时/计数器(简称定时器)是单片机编程中至关重要的一部分,再简单的单片机也会带有定时器. 也许你会觉得我们已经在delay函数中接触过定时器了,然而并不是, ...
- url的分发
一.分发 补充:通过查看源码:可以通过二级路由include进行二次分发 位置:urls.py urlpatterns = [ path('admin/', admin.site.urls), pat ...
- 12.instanceof和类型转换
Instanceof: 判断一个对象是什么类型的~,可以判断两个类之间是否存在父子关系 package com.oop.demo07; public class Person { public voi ...
- EFCore-脚手架Scaffold发生Build Failed问题的终极解决
大家在使用EntityFrameworkCore的DBFirst的脚手架(Scaffolding)时应该遇到过Build Failed的错误,而没有任何提示,我也遇到过不少次,目前已经完美解决并将排查 ...
- 「 神器 」在线PDF文件管理工具和图片编辑神器
每天进步一丢丢,连接梦与想 在线PDF文件管理工具 完全免费的PDF文件在线管理工具,其功能包括:合并PDF文件.拆分PDF文件.压缩PDF文件.Office文件转换为PDF文件.PDF文件转换为JP ...
- 程序员你为什么这么累【三】:编码习惯之Controller规范
作者:晓风轻本文转载自:https://zhuanlan.zhihu.com/p/28717374 第一篇文章中,我贴了2段代码,第一个是原生态的,第2段是我指定了接口定义规范,使用AOP技术之后最终 ...
- Browser Security-同源策略、伪URL的域
同源策略 同源策略的文档模型 同源策略(Same Origin policy,SOP),也称为单源策略(Single Origin policy),它是一种用于Web浏览器编程语言(如JavaScri ...