芒果的力量 发表于 2017-10-18 10:20:22

centos7 启动脚本

/usr/lib/systemd/system/nginx.service编辑


Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target


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


WantedBy=multi-user.target


加 +x 权限
#systemctl daemon-reload

页: [1]
查看完整版本: centos7 启动脚本