vi /lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/usr/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl enable nginx.service
systemctl disable nginx.service
systemctl start nginx.service
systemctl restart nginx.service
systemctl stop nginx.service
systemctl status nginx.service
systemctl list-units --type=service
CentOS 7 nginx配置开机启动
未经允许不得转载:工具盒子 » CentOS 7 nginx配置开机启动