systemctl
是 systemd
的命令行工具,用于管理系统的服务单元。以下是一些常用的 systemctl
命令及其用法:
管理服务单元
-
启动一个服务单元:
systemctl start <unit>
例如,启动 nginx
服务:
systemctl start nginx
-
停止一个服务单元:
systemctl stop <unit>
例如,停止 nginx
服务:
systemctl stop nginx
-
重新启动一个服务单元:
systemctl restart <unit>
例如,重新启动 nginx
服务