問(wèn)題場(chǎng)景
服務(wù)器重啟后,重啟nginx時(shí)報(bào)錯(cuò)nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)浪漠,進(jìn)入到logs目錄發(fā)現(xiàn)確實(shí)沒(méi)有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
此時(shí)去logs目錄下查看發(fā)現(xiàn)nginx.pid文件已經(jīng)生成了