从linux系统版本centos 6.x到centos 7.x变化整体不大,不过还是有很多地方需要我们注意的,最为直观的当属服务管理命令,之前centos 7.x之前的系统我们使用service和chkconfig来管理服务器,而到了centos 7.x 这个版本的linux中,systemctl 一个命令就搞定了,它集成了service和chkconfig 的功能于一身。这里今天简单说明一下:
systemctl start *.service #启动某服务
systemctl stop *.service #停止某服务
systemctl restart *.service #重启某服务
systemctl reload *.service #重载某服务配置文件
systemctl status *.service #查询某服务运行状态
systemctl is-enabled *.service #查看某服务是否开机启动
systemctl enable *.service #设置开机启动
systemctl disable *.service #取消开机启动
systemctl –failed #查看启动失败的服务
注:*指服务的名字,比如重启、iptables,我们就会这样操作:
[root@21yunwei network-scripts]# systemctl stop iptables.service
[root@21yunwei network-scripts]# systemctl start iptables.service
[root@21yunwei network-scripts]# systemctl restart iptables.service
[root@21yunwei network-scripts]# systemctl status iptables.service
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: active (exited) since Fri 2016-06-17 17:52:05 CST; 16s ago
Process: 48807 ExecStop=/usr/libexec/iptables/iptables.init stop (code=exited, status=0/SUCCESS)
Process: 48870 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 48870 (code=exited, status=0/SUCCESS)
Jun 17 17:52:05 21yunwei systemd[1]: Starting IPv4 firewall with iptables...
Jun 17 17:52:05 21yunwei iptables.init[48870]: iptables: Applying firewall rules: [ OK ]
Jun 17 17:52:05 21yunwei systemd[1]: Started IPv4 firewall with iptables.
[root@21yunwei network-scripts]# systemctl is-enabled iptables.service
enabled
补充一点小技巧:systemctl 默认没有服务器名不全,原因是最小化安装没有进行安装包bash-completion,需要执行下边命令后重新登录系统就可以看到命令补全了。
yum install -y bash-completion
热血大作战 安卓最新版v2.1.166
下载凡尔赛法环免广告版 最新版v1.69.1
下载天煞异种 安卓版v1.0.21
下载十三月 (Undecember)最新官方中文版v3.26.0200
下载星露谷物语sve 安卓版v1.5.6.52
星露谷物语sve手机版是游戏的超大拓展Mod内容,全称Sta
动物园大亨 手机版v2.0
动物园大亨是一款模拟动物园经营的休闲放置游戏,采用了卡通画风
蜜蜂园林钞票不减反增版 v0.1.68
蜜蜂园林无限道具版是游戏的破解版本,在该版本中为玩家提供了足
幻想熔炉失落帝国的世界 安卓版v2.16.2
幻想熔炉失落帝国的世界是一款魔法卡通风格的城市模拟经营类游戏
我的女友是声优免广告 安卓版v1
我的女友是声优免广告是一款非常好玩的模拟经营类手游,玩家在游