Nginx 1.8 单元控制文件
[Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network-online.target remote-fs.target nss-lookup.target Wants=network-online.target [Service] Type=forking ExecStartPre=/usr/local/nginx/sbin/nginx -t ExecStart=/usr/local/nginx/sbin/nginx ExecStartPost=/bin/sleep 0.2 ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
请注意 ExecStartPost=/bin/sleep 0.2 不加的话可能会出现pid文件不可读的情况。
posted on 2020-11-11 11:12 jonney_wang 阅读(140) 评论(0) 编辑 收藏 举报