情况:
[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -t (测试配置文件语法是否正确)
nginx: the configuration file /usr/local/nginx-1.5.1//conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx-1.5.1//conf/nginx.conf test is successful
[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -s reload (平滑重启)
nginx: [alert] kill(22359, 1) failed (3: No such process)
[root@qwer init.d]# ps -ef|grep nginx
root 22426 1 0 13:44 ? 00:00:08 gedit /usr/local/nginx-1.5.1/logs/access.log
root 22781 5280 0 14:33 pts/2 00:00:00 grep nginx
解决方法:
[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -c /usr/local/nginx-1.5.1/conf/nginx.conf (使用-c指定配置文件)[root@qwer init.d]# /usr/local/nginx-1.5.1/sbin/nginx -s reload
[root@qwer init.d]# ps -ef|grep nginx
root 22426 1 0 13:44 ? 00:00:08 gedit /usr/local/nginx-1.5.1/logs/access.log
root 22803 1 0 14:38 ? 00:00:00 nginx: master process /usr/local/nginx-1.5.1/sbin/nginx -c /usr/local/nginx-1.5.1/conf/nginx.conf
nobody 22807 22803 0 14:38 ? 00:00:00 nginx: worker process
root 22809 5280 0 14:38 pts/2 00:00:00 grep nginx