| Systemctl是systemd用于管理系统和管理服务的工具。许多现代Linux发行版,如Ubuntu、Debian、Fedora、Linux Mint、OpenSuSE、Redhat都采用systemd作为默认的init系统。 |
使用systemctl,可以启动、停止、重新加载、重启服务、列出服务单元、检查服务状态、启用/禁用服务、管理运行级别和电源管理。在本文中将展示如何在Linux中使用systemctl命令来管理systemd服务。
使用systemctl命令 Start/Stop/Restart/Reload 服务
使用systemctl启动服务时,命令格式:systemctl start [service-name]。例如,启动firewalld服务:
[root@localhost ~]# systemctl start firewalld
与以前老版本的linux中的service命令相反,systemctl start命令不输出任何内容。
要停止服务,请使用systemctl stop [service-name]。例如,停止firewalld服务:
[root@localhost ~]# systemctl stop firewalld

要重新启动服务,请使用systemctl restart [service-name],例如:
[root@localhost ~]# systemctl restart firewalld

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



