Nginx: [ERROR] Invalid PID number "in"/usr/local/nginx/logs/nginx.pid "

Source: Internet
Author: User

System version: CentOS 6.5 x86_64

Nginx version: Nginx-1.6.1

today in the test upgrade Nginx version to nginx-1.7.0, a little bit of an episode, error nginx: [ERROR] Invalid PID number "in"/usr/local/nginx/logs/nginx.pid " , this record the following to strengthen the memory, but also to avoid similar errors in the future.

Step1. After the upgrade is complete, a reboot is performed (the Kill-quit master process number can also be executed)

Step2. Perform related tests and /usr/local/nginx/sbin/nginx-s reload Smooth restart error, see

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/83/C3/wKioL1d7hFrReQMpAACIdjSJ6w4039.jpg-wh_500x0-wm_3 -wmp_4-s_2452649944.jpg "title=" 5.jpg "alt=" Wkiol1d7hfrreqmpaacidjsj6w4039.jpg-wh_50 "/>

#升级是成功的, but the service did not start.

Step3. Add the main process number to the /usr/local/nginx/logs/nginx.pid file, unexpectedly error Nginx: [Alert] Kill (1176, 1) failed (3:no such process) 1176 process failed, no this process, it seems to have been killed

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/83/C3/wKioL1d7g9eyxnWXAABJBErAYIs633.jpg-wh_500x0-wm_3 -wmp_4-s_1048522939.jpg "title=" 2.jpg "alt=" Wkiol1d7g9eyxnwxaabjberayis633.jpg-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/83/C3/wKioL1d7hPmBJEU_AAA0CMvj5lw028.jpg-wh_500x0-wm_3 -wmp_4-s_1466788756.jpg "title=" 3.jpg "alt=" Wkiol1d7hpmbjeu_aaa0cmvj5lw028.jpg-wh_50 "/>

#此时看到进程已变为1196, stating that the previous process operation was invalid

Step4. Later think, should be did not do start service operation, on the execution of /usr/local/nginx/sbin/nginx, Wood has thought, sure enough is this problem, uppercase embarrassment Ah!!

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/83/C3/wKioL1d7hkvjlf-PAABjy4K1mtQ565.jpg-wh_500x0-wm_3 -wmp_4-s_1035715546.jpg "title=" 4.jpg "alt=" Wkiol1d7hkvjlf-paabjy4k1mtq565.jpg-wh_50 "/>

#此时可以看到, the service has been successfully started, the PID file has the corresponding process number, through the page test all normal, upgrade declared success!

This article is from "Tornado" blog, please make sure to keep this source http://ruilong.blog.51cto.com/4043170/1796049

Nginx: [ERROR] Invalid PID number "in"/usr/local/nginx/logs/nginx.pid "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.