作者:Carrie
出处:https://home.cnblogs.com/u/hanjiali
版权:本文版权归作者和博客园共有
转载:欢迎转载,但未经作者同意,必须保留此段声明;必须在文章中给出原文连接;否则必究法律责任

1,简介

     systemctl是系统服务管理器,用过centos6的人再用centos7会发现,有很多命令已经不能使用,而centos7中多了新的命令就是systemctl,这是centos7中的一大特点将centos6中的chkconfig和service命令同意归systemctlI进行管理。

2.命令格式

启动服务

systemctl start service

关闭服务

systemctl stop service

 重新启动服务

systemctl restart service  

查看服务器状态

systemctl status service

开机自动开启服务|关闭服务

systemctl enble|disable service 

重新加载服务器配置文件

systemctl reload service

 3.实例

linux systemctl命令实例

  1.启动nfs服务

 

 systemctl start nfs-server.service

  2.设置开机自启动

 

 systemctl enable nfs-server.service

  3.停止开机自启动

 

 systemctl disable nfs-server.service

  4.查看服务当前状态

 

  systemctl status nfs-server.service

  5.重新启动某服务

 

systemctl restart nfs-server.service

  

  6.查看所有已启动的服务

 

 systemctl list -units --type=service

 

posted on 2020-11-07 10:49  不吃葡萄楞吐皮  阅读(684)  评论(0编辑  收藏  举报