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

**URL:** <https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591>\
**Category:** NGINX\
**Created:** [November 24, 2010, 5:14pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591 "2010-11-24T17:14:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [November 24, 2010, 5:14pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/1 "2010-11-24T17:14:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 24, 2010, 5:42pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/2 "2010-11-24T17:42:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 24, 2010, 11:53pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/3 "2010-11-24T23:53:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 24, 2010, 6:04pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/4 "2010-11-24T18:04:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 25, 2010, 11:59am UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/5 "2010-11-25T11:59:18Z")

</div>

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.

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Basic procedure is as usual:

./configure && make && make install

Maxim D.

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 26, 2010, 3:36pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/6 "2010-11-26T15:36:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 26, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/7 "2010-11-26T14:59:11Z")

</div>

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.
> 
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](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.

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [November 26, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/nginx-worker-process-exited-with-fatal-code-2-and-cannot-be-respawn-eventfd-failed/199591/8 "2010-11-26T16:44:47Z")

</div>

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. 😃  
😃

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!
