linux 中如何使用systemd启动和停止服务?

要用systemd启动服务,可以使用 systemctl start 服务名    进行启动,例如启动nginx 服务,可以运行如下命令:  systemctl start nginx。

要用systemd停止服务,可以使用 systemctl stop 服务名    进行停止,例如停止nginx 服务,可以运行如下命令:  systemctl stop nginx。