systemctl

Posted forlive

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了systemctl相关的知识,希望对你有一定的参考价值。

 

centos6

centos7

启动

service NAME start

systemctl start NAME[.service]

停止

service NAME stop

systemctl stop NAME[.service]

重启

service NAME restart

systemctl restart NAME[.service]

重载

server NAME reload

systemctl reload NAME[.service]

状态

service NAME status

systemctl status NAME[.service]

条件式重启(启动重启,不启动不重启)

service NAME condrestart

systemctl try-restart NAME[.service]

查看某服务当前状态

 

systemctl is-active NAME[.service]

查看所有已经激活的服务[所有]

 

systemctl list-units –type service [--all]

设定开机启动

chkconfig NAME on

systemctl enable NAME[.service]

禁止开机启动

chkconfig NAME off

systemctl disable NAME[.service]

查看所有开机启动

chkconfig --list

systemctl list-unit-files –type service

查看某服务是否开机紫气

 

systemctl is-enabled NAME[.service]

查看运行级别

runlevel

systemctl list-units –type target

查看默认运行级别

/etc/inittab

systemctl get-default

修改默认级别

 

systemctl set-default NAME.target

切换至紧急救援模式

 

systemctl rescue

以上是关于systemctl的主要内容,如果未能解决你的问题,请参考以下文章

linux命令之systemctl 详解

linux命令之systemctl 详解

linux命令之systemctl 详解

linux基础操作命令

Linux 服务控制与运行级别

还在百度Linux命令?推荐一套我用起来特顺手的命令!