問題場景
服務(wù)器重啟后,重啟nginx時報錯nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),進(jìn)入到logs目錄發(fā)現(xiàn)確實沒有nginx.pid文件
cd /usr/local/nginx/sbin/
./nginx -s reload
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
ngx_http_fastdfs_set pid=1412
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
解決辦法
使用指定nginx.conf文件的方式重啟nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
此時去logs目錄下查看發(fā)現(xiàn)nginx.pid文件已經(jīng)生成了