Centos7下openresty自启动配置

vi /usr/lib/systemd/system/nginx.service

[Service]
Type=forking
PIDFile=/usr/local/openresty/nginx/logs/nginx.pid
ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t
ExecStart=/usr/local/openresty/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl daemon-reload

systemctl enable nginx.service

systemctl start nginx.service

猜你喜欢

转载自stevendu.iteye.com/blog/2269166
今日推荐