Systemd
Systemd
创建服务
vim /etc/systemd/system/nginx.service
1 | [Unit] |
初始化时自动启动服务
1 | ln -s /lib/systemd/system/nginx.service /etc/systemd/system/multi-user.target.wants/nginx.service |
或者1
systemctl enable nginx
刷新配置
1 | systemctl daemon-reload |
启动、重启、停止
启动nginx
1
$ systemctl start nginx
重启nginx
1
$ systemctl restart nginx
停止nginx
1
$ systemctl stop nginx
开机启动
1 | systemctl enable nginx |
查看状态
1 | systemctl status nginx |
参考
本站采用「署名 4.0 国际」进行许可。