四、Linux的系统服务管理工具(systemd)

在centos7及以后,重要的改变就是使用systemd管理机制,目前大多数linux发行版都支持systemd管理机制。

所以systemd不仅能够初始化系统开机,还能管理linux系统服务。

为了便于linux用户操作系统服务的管理,systemd提供了systemctl命令工具进行systemd的各项操作。

常用功能:启动start、停止stop、重启服务restart,任何一个软件或者服务,你都可以尝试着敲入命令systemctl restart 服务名.service

例如:

  systemctl start httpd.service    启动 httpd服务

  systemctl stop httpd.service 停止 httpd服务

  systemctl restart httpd.service 重新启动服务

  systemctl try-start httpd.service 服务在运行状态下重新启动服务

  systemctl reload httpd.service  重新加载配置文件

查看、禁止、启用服务

  systemctl endable httpd.service   表示httpd服务开机启动

  systemctl disable httpd.service   表示httpd服务开机关闭

  systemctl status  httpd.service   查看httpd服务状态,是否开启

原文地址:https://www.cnblogs.com/fanfancs/p/14141778.html