<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 22, 2017 at 10:37 PM, Gena Makhomed <span dir="ltr"><<a href="mailto:gmm@csdoc.com" target="_blank">gmm@csdoc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
This is bug in nginx code? And this bug should be fixed in nginx?<br>
<br>
But "daemon(); write_pidfile();" is common pattern<br>
used by many services and even in library functions.<br>
<br></blockquote><div><br></div><div>It may be common, but not necessarily correct. The parent process should only exit <i>after</i> finishing all the preparations (i.e. something like "fork(); write_pidfile(); exit()"), since systemd uses the exit as a signal that the daemon is now "ready".</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>