[Unit] Description=nginx After=network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStart=/serve/nginx/sbin/nginx ExecReload=/serve/nginx/sbin/nginx -s reload ExecStop=/serve/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target
#重載系統服務: systemctl daemon-reload #設置開機啓動: systemctl enable nginx.service #啓動服務: systemctl start nginx.service #中止服務: systemctl stop nginx.service #重啓服務: systemctl reload nginx.service