Nginx: worker process exited with fatal code 2 and cannot be respawn | eventfd() failed

I successfully configured nginx and had everything working fine until a
few days back when i got a message from the systems administrator that
the ruby application was not responding upon investigation, I noticed
when i start nginx its only the master process that runs. I went ahead
to check the error logs and found this:

ERROR LOGS:

2010/11/24 15:48:03 [emerg] 18529#0: eventfd() failed (38: Function not
implemented)
2010/11/24 15:48:03 [emerg] 18530#0: eventfd() failed (38: Function not
implemented)
2010/11/24 15:48:03 [emerg] 18531#0: eventfd() failed (38: Function not
implemented)
2010/11/24 15:48:03 [emerg] 18532#0: eventfd() failed (38: Function not
implemented)
2010/11/24 15:48:03 [alert] 18457#0: worker process 18529 exited with
fatal code 2 and can not be respawn
2010/11/24 15:48:03 [alert] 18457#0: worker process 18530 exited with
fatal code 2 and can not be respawn
2010/11/24 15:48:03 [alert] 18457#0: worker process 18531 exited with
fatal code 2 and can not be respawn
2010/11/24 15:48:03 [alert] 18457#0: worker process 18532 exited with
fatal code 2 and can not be respawn
2010/11/24 15:48:07 [crit] 18457#0: the changing binary signal is
ignored: you should shutdown or terminate before either old or new
binary’s process
2010/11/24 15:48:07 [crit] 17142#0: the changing binary signal is
ignored: you should shutdown or terminate before either old or new
binary’s process

Please note that i used yum to install nginx and it is running on a
CentOS. It was running perfectly. I have researched into the problem
but most solutions suggest that i recompile the nginx
“–without-file-aio” option which does not help me.
Can someone please direct me in the right path as to the best solution
to this problem, and what might be the possible cause. Thanks!

Hello!

On Wed, Nov 24, 2010 at 05:14:45PM +0100, Eric A. wrote:

[…]

2010/11/24 15:48:03 [emerg] 18529#0: eventfd() failed (38: Function not
implemented)

[…]

Please note that i used yum to install nginx and it is running on a
CentOS. It was running perfectly. I have researched into the problem
but most solutions suggest that i recompile the nginx
“–without-file-aio” option which does not help me.

You have to recompile nginx without --with-file-aio configure
option.

Your system lacks eventfd() support and nginx compiled with
–with-file-aio configure option (on another host? compile on the
host in question with --with-file-aio should fail unless your
system headers screwed up) won’t work on it.

Maxim D.

Gena M. wrote in post #963628:

On 24.11.2010 18:41, Maxim D. wrote:

2010/11/24 15:48:03 [emerg] 18529#0: eventfd() failed (38: Function not
implemented)

Please note that i used yum to install nginx and it is running on a
CentOS. It was running perfectly. I have researched into the problem
but most solutions suggest that i recompile the nginx
“–without-file-aio” option which does not help me.

You have to recompile nginx without --with-file-aio configure
option.

…or just update CentOS to latest version

eventfd() backported in newer CentOS5/RHEL5 kernel.


Best regards,
Gena

Hi Gena and Maxim,Thank you both for the quick response.
Gena:
I must add that the application is hosted on a remote server which I do
not have control over. So updating to the latest CentOS is not an option
and if you think otherwise please let me know.
Maxim:
I would be glad if you can point me to resources on how I can recompile
nginx without --with-file-aio configure since I am not an expect on
compiling nginx, and its looks like its my only option in this case.

Thanks.

On 24.11.2010 18:41, Maxim D. wrote:

2010/11/24 15:48:03 [emerg] 18529#0: eventfd() failed (38: Function not
implemented)

Please note that i used yum to install nginx and it is running on a
CentOS. It was running perfectly. I have researched into the problem
but most solutions suggest that i recompile the nginx
“–without-file-aio” option which does not help me.

You have to recompile nginx without --with-file-aio configure
option.

…or just update CentOS to latest version

eventfd() backported in newer CentOS5/RHEL5 kernel.


Best regards,
Gena

Hello!

On Wed, Nov 24, 2010 at 11:53:48PM +0100, Eric A. wrote:

Hi Gena and Maxim,Thank you both for the quick response.
Gena:
I must add that the application is hosted on a remote server which I do
not have control over. So updating to the latest CentOS is not an option
and if you think otherwise please let me know.
Maxim:
I would be glad if you can point me to resources on how I can recompile
nginx without --with-file-aio configure since I am not an expect on
compiling nginx, and its looks like its my only option in this case.

http://wiki.nginx.org/Install#Building_Nginx_From_Source

Basic procedure is as usual:

./configure && make && make install

Maxim D.

Hello!

On Fri, Nov 26, 2010 at 02:59:11PM +0100, Eric Agbeli wrote:

not have control over. So updating to the latest CentOS is not an option
./configure && make && make install

Maxim D.

Hi in trying to recompile with the command -$./configure
–without-file-aio. I am faced with this error.

./configure: error: invalid option “–without-file-aio”

There are no configure argument --without-file-aio, and this error
is expected.

I alternatively compiled with the latest nginx source file(nginx-0.8.53)
without “–with-file-aio” configure option and it compiled ok. But after
reinstalling nginx on the system and running nginx i have the same error
existing in the error logs.

Most likely you are starting wrong binary, not the one you’ve just
compiled and installed.

Please follow startup scripts you use to find binary you actually
starting and examine it (with ls -l to check date/time, via
running with -V switch to see configure arguments).

Maxim D.

Maxim D. wrote in post #963825:

Hello!

On Wed, Nov 24, 2010 at 11:53:48PM +0100, Eric A. wrote:

Hi Gena and Maxim,Thank you both for the quick response.
Gena:
I must add that the application is hosted on a remote server which I do
not have control over. So updating to the latest CentOS is not an option
and if you think otherwise please let me know.
Maxim:
I would be glad if you can point me to resources on how I can recompile
nginx without --with-file-aio configure since I am not an expect on
compiling nginx, and its looks like its my only option in this case.

http://wiki.nginx.org/Install#Building_Nginx_From_Source

Basic procedure is as usual:

./configure && make && make install

Maxim D.

Hi in trying to recompile with the command -$./configure
–without-file-aio. I am faced with this error.

./configure: error: invalid option “–without-file-aio”

I alternatively compiled with the latest nginx source file(nginx-0.8.53)
without “–with-file-aio” configure option and it compiled ok. But after
reinstalling nginx on the system and running nginx i have the same error
existing in the error logs.

Maxim D. wrote in post #964105:

Hello!

On Fri, Nov 26, 2010 at 02:59:11PM +0100, Eric Agbeli wrote:

not have control over. So updating to the latest CentOS is not an option
./configure && make && make install

Maxim D.

Hi in trying to recompile with the command -$./configure
–without-file-aio. I am faced with this error.

./configure: error: invalid option “–without-file-aio”

There are no configure argument --without-file-aio, and this error
is expected.

I alternatively compiled with the latest nginx source file(nginx-0.8.53)
without “–with-file-aio” configure option and it compiled ok. But after
reinstalling nginx on the system and running nginx i have the same error
existing in the error logs.

Most likely you are starting wrong binary, not the one you’ve just
compiled and installed.

Please follow startup scripts you use to find binary you actually
starting and examine it (with ls -l to check date/time, via
running with -V switch to see configure arguments).

Maxim D.

Thanks a mil for drawing my attention to the fact that i was running the
old binary. I investigated further and realized that the startup script
as you stated was pointing to an old binary. So I modified the script to
point to the new binary and all seems to be working perfectly well. :smiley:
:smiley:

I must add that it seems right to build with the new source which is
nginx-0.8.53. One other thing was that, I faced an error while pointing
to the new binary file. Error is shown below

unknown directive “ssl” in /etc/nginx/nginx.conf

The solution to solving this problem was to recompile nginx with the
configure option “–with-http_ssl_module”.

./configure --with-http_ssl_module

THANKS MAXIM!!! ‘MEDAASE’ as we say in my local dialect.
Cheers!