Running code in nginx's master process

Maxim Dounin mdounin at
Thu Oct 24 16:49:16 UTC 2013


On Thu, Oct 24, 2013 at 08:37:03AM -0400, mzabani wrote:

> It seems like the init_module callback is not executed in nginx's master
> process. At least, I've printed a call to getpid() and the pid returned was
> that of a process that wasn't running, which makes me think it is executed
> in a process that forks the master process itself.

Yes, the init_module callback is called after configuration parsing, 
and on initial startup this happens before demonization, hence 
there is no master process yet.  On reconfiguration it's executed 
in the master process itself.

Maxim Dounin

More information about the nginx mailing list