使用systemctl管理nginx

[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStartPre=/data/apps/nginx/sbin/nginx -t -c /data/apps/nginx/conf/nginx.conf
ExecStart=/data/apps/nginx/sbin/nginx
ExecReload=/data/apps/nginx/sbin/nginx -s reload
ExecStop=/data/apps/nginx/sbin/nginx -s stop
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl daemon-reload

systemctl start nginx 

systemctl stop nginx

systemctl status nginx

posted @ 2019-12-21 16:31  Ray_chen  阅读(3952)  评论(0编辑  收藏  举报