{"id":886,"date":"2019-08-21T08:02:43","date_gmt":"2019-08-21T01:02:43","guid":{"rendered":"https:\/\/trichev.com\/blog\/?p=886"},"modified":"2019-08-21T08:09:58","modified_gmt":"2019-08-21T01:09:58","slug":"how-to-fix-nginx-error-failed-to-read-pid-from-file","status":"publish","type":"post","link":"https:\/\/trichev.com\/blog\/2019\/08\/21\/how-to-fix-nginx-error-failed-to-read-pid-from-file\/","title":{"rendered":"How to Fix NGINX error \u201cFailed to read PID from file&#8221;"},"content":{"rendered":"<p>It seems to be a race between systemd and nginx. As if systemd was expecting the PID file to be populated before nginx had the time to create it.<\/p>\n<pre><code>mkdir \/etc\/systemd\/system\/nginx.service.d\r\nprintf \"[Service]\\nExecStartPost=\/bin\/sleep 0.1\\n\" &gt; \/etc\/systemd\/system\/nginx.service.d\/override.conf\r\nsystemctl daemon-reload\r\nsystemctl restart nginx<\/code><\/pre>\n<p>&nbsp;<br \/>\nLink: <a href=\"http:\/\/alfredoroca.github.io\/nginx\/2016\/09\/04\/How-to-solve-failure-read-of-nginx-pid-file\">http:\/\/alfredoroca.github.io\/nginx\/2016\/09\/04\/How-to-solve-failure-read-of-nginx-pid-file<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It seems to be a race between systemd and nginx. As if systemd was expecting the PID file to be populated before nginx had the time to create it. mkdir \/etc\/systemd\/system\/nginx.service.d printf &#8220;[Service]\\nExecStartPost=\/bin\/sleep 0.1\\n&#8221; &gt; \/etc\/systemd\/system\/nginx.service.d\/override.conf systemctl daemon-reload systemctl restart nginx &nbsp; Link: http:\/\/alfredoroca.github.io\/nginx\/2016\/09\/04\/How-to-solve-failure-read-of-nginx-pid-file<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[231],"tags":[32,251,217,14,11],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/886"}],"collection":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/comments?post=886"}],"version-history":[{"count":5,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":891,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions\/891"}],"wp:attachment":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/media?parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/categories?post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/tags?post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}