Nginx log cutting time is adopted nginx - reload to restart, to be able to generate log, but in the long run will appear nginx: [error] open () "/usr/local/nginx/logs/nginx pid" failed (2: No to the file or directory),
I describe my mistake:
At the wrong first, secondly nginx kind of pid file didn't, the last nginx process is still alive is nginx -s command will quote this wrong, less like pid not only the body, the soul
The error, more wonderful is three virtual machine at the same time appear this kind of circumstance, three virtual machine is not in the same physical machine, repeated several times, online methods are solution, every time to manually check sounded very trouble,
One, stop before nginx nginx - s - s reload will quote this wrong, but because they kill nginx without pid, even nginx, obviously can't reload nginx - s, not I appear this kind of situation,
Two, I check the web log cutting and with kill - USR1 $(cat/usr/local/nginx/logs/nginx pid) # notice nginx to regenerate new log, without restarting should better,
Three, most of whom were the answer/usr/local/nginx/sbin/nginx - c/usr/local/nginx/conf/nginx. Conf, is suspicion he very trouble to manually check every time,
Four, I every day in execution of sh scripts to add the nginx -s reload command returns a value judgment, when an error $? Is not zero, then kill nginx process then starts to nginx directory,
Hope someone can help us see why nginx didn't hang but nginx pid will be lost, is there any solution to