<强>
本文档介绍RHEL6的服务和RHEL7的systemctl的区别
强>
<强>
运行级别概念的区分
强>
<前>
System V  init 运行级别systemd 目标名称作用
0 runlevel0.target,定时关机。关目标机
1 runlevel1.target救援。单目标用户模式
2 runlevel2.target,多用户。目标等同于级别,3
3 runlevel3.target,多用户。目标多用户的文本界面
4 runlevel4.target,多用户。目标等同于级别,3
5 runlevel5.target图形。目标多用户的图形界面
6 runlevel6.target,重启。目标重启
紧急应急。目标紧急,壳
>之前
<强>
systemctl管理服务的启动,重启、停止,重载,查看状态等常用
命令
区分
强>
<前>
System V  init 命令(RHEL 6) systemctl 命令(RHEL 7)作用
service foo 开始systemctl start  foo。服务启动服务
service foo 重启systemctl restart  foo。服务重启服务
service foo 停止systemctl stop  foo。服务停止服务
service foo 重载systemctl reload  foo。服务重新加载配置文件(不终止服务)
systemctl  service foo 地位;status  foo。服务查看服务状态
>之前
<强>
systemctl设置服务开机启动,不启动,查看各级别下服务启动状态等常用命令
强>
<前>
System V  init 命令(RHEL 6) systemctl 命令(RHEL 7)作用
chkconfig foo  systemctl enable foo。服务开机自动启动
chkconfig foo  systemctl disable foo。服务开机不自动启动
chkconfig foo systemctl  is-enabled foo。服务查看特定服务是否为开机自动启动
chkconfig ——列表systemctl list-unit-files ——type=服务查看各个级别下服务的启动与禁用情况
>之前