systemd 服务管理
systemd 是 Linux 系统的初始化系统和服务管理器,支持并行启动、依赖管理。
常用命令:
# 启动服务
sudo systemctl start nginx
# 设置开机自启
sudo systemctl enable nginx
# 查看服务状态
systemctl status nginx
# 重新加载配置
sudo systemctl reload nginx单元文件:位于 /etc/systemd/system/,可自定义服务。
