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 iptables.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

CentOS 7.0默认使用的是firewall作为防火墙,代替了以前的iptables
关闭firewall:
systemctl stop firewalld.service                #停止firewall
systemctl disable firewalld.service           #禁止firewall开机启动
 
 
 
 
3.ext=>XFS
以往的centos使用的文件系统是  ext2/ext3/ext4   
其对应的的调整命令是resize2fs

CentOS7.0的默认文件系统类型是Xfs
其对应的调整命令是 xfs_growfs
不同文件系统类型对应的创建、检查、调整命令不同,要注意区分。

 
 
 
 
4. 查看IP地址  也进行了修改
CentOS 7.0  使用ifconfig 提示无此命令
可以使用 ip命令 
 
1.设置、查看和删除IP地址:
设置IP地址——
ip addr add 192.168.1.1/24 dev eth0
查看IP地址——
 ip addr
ip addr show eth0
删除IP地址——
ip addr del 192.168.1.1 dev eth0
 
2.修改路由:
查看路由表——
ip route show
查看路由包来自的接口(本地接口)——
ip route get 123.125.114.144
更改默认路由——
ip route add default via 192.168.1.254
 
3.显示网络信息:
显示网络统计信息——
ip -s link
查看ARP条目——
ip neigh(或neighbour)
监控netlink消息——
ip monitor all
 
4.激活或停止网络接口:
激活网络接口——
ip link set eth0 up
停止网络接口——
ip link set eth0 down
 
    好吧,用惯ifconfig的我着实花了点时间来熟悉这玩意儿。另外,
netstat命令也被ss命令取代了!

Centos 7 主要命令改动 service chkconfig iptables的更多相关文章

  1. Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.service not loaded.

    背景: 测试部署NetCore 项目到linux 系统时,窗口显示项目部署成功:但是本机无法访问(linux 在虚拟机上[ centos 7.6] );  如下图↓ 能够相互ping  通,(Xshe ...

  2. Centos7下的systemctl命令与service和chkconfig

    博主使用的操作系统是最新的CentOS 7,所以可能和网上一些老的博文有一定出入,那是因为版本更新的原因. 这里写图片描述1 service service命令用于对系统服务进行管理,比如启动(sta ...

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

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

  4. 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 ...

  5. centos 的系统管理命令 service systemctl

    centos 的 systemctl 命令 systemctl is-enabled *.service     #查询服务是否开机启动 systemctl enable *.service    # ...

  6. (转)CentOS 7.0关闭默认防火墙启用iptables防火墙

    场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...

  7. CentOS 7.0关闭默认防火墙启用iptables防火墙

    转自:https://www.cnblogs.com/lixuwu/p/6087023.html 阅读目录 1 配置防火墙,开启80端口.3306端口 2 关闭SELINUX 3 CentOS 配置防 ...

  8. Linux下 CentOS 7 对比6 改动详解 及 系统安装

    系统基础服务变化 操作系统 本文CentOS7 为最新版7.5 本文CentOS6 为6.9 操作 Centos6 Centos7 对比 自动补全 只支持命令.文件名 支持命令.选项.文件名 文件系统 ...

  9. Failed to stop iptables.service: Unit iptables.service not loaded.解决方法

    CentOS7中执行 service iptables start/stop 会报错Failed to start iptables.service: Unit iptables.service fa ...

随机推荐

  1. Nhibernate的Session和StatelessSession性能比较

    Nhibernate的Session和StatelessSession性能比较 作者:Jesai 一个月入30K的大神有一天跟我说:我当年在你现在这个阶段,还在吊儿郎当呢!所以你努力吧! 有时候,一个 ...

  2. Djaingo 随机生成验证码(PIL)

    基础: https://www.cnblogs.com/wupeiqi/articles/5812291.html 实例: https://www.cnblogs.com/6324TV/p/88112 ...

  3. Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name

    目前有发现的两种情况 第一种:是在继承jpa的时候检查实体类@id和@Entity引进的包是否是 import javax.persistence.Id imprt javax.persistence ...

  4. PHP——常量

    一.什么是常量 常量可以理解为值不变的量(如圆周率)或者是常量值被定义后,在脚本的其他任何地方都不可以被改变.PHP中的常量分为自定义常量和系统常量,自定义常量是根据我们开发的需要,而定义的常量,它通 ...

  5. 解决python爬虫requests.exceptions.SSLError: HTTPSConnectionPool(host='XXX', port=443)问题

    爬虫时报错如下: requests.exceptions.SSLError: HTTPSConnectionPool(host='某某某网站', port=443): Max retries exce ...

  6. (转) fuzzing XSS filter

    //转自isno在wooyun知识库所写 题记:这是09年自己写的总结文章,之后多年也不搞这个了,技术显然是过时了,但我觉得思路还是有用的,算抛砖引玉吧,各位见笑 0x00 前言 这是一篇学习总结,首 ...

  7. 嗯 想写个demo 苦于没数据

    step 1: 来点数据: 各种数据 随你便了. step 2: 来个 服务端 step 3 : 客户端 调用

  8. allegro设置内存分配器的一个坑

    看过<游戏引擎架构>后我开始对内存的分配问题关注,一直想用内存分配器来管理游戏的内存.前两天发现了有许多第三方内存分配器可以用.最后挑中了nedmalloc,这个库也是ogre所使用的,测 ...

  9. UIKit, AppKit, 以及其他API在多线程当中的使用注意事项

    UIKit, AppKit, 以及其他API在多线程当中的使用注意事项 Overview The Main Thread Checker is a standalone tool for Swift ...

  10. Client API Object Model - Grid Context(3.3)

    Grids 网格,以表格的形式显示数据, 网格可以跨越整个form,也可以是form中的一项. 被称为子网格(subgrid). grid有两种, 一种是read-only grid, 另一种是edi ...