Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a FCGI spawn app on nginx on FreeBSD. It is buggy and I would like to analyse the .core file of the crash. But I don't have any clue where its generated. Does anyone know?

share|improve this question
    
Was a core dump generated at all? –  Michael Hampton Feb 19 at 15:05
    
Thats what I'm trying to figgure out. The case SHOULD have generated one. But I can't find it. whilest other programms do generate a core file for sure. –  Zaibis Feb 19 at 15:06
    
The problem is still not solved, and my server still keeps crashing :x –  Zaibis Feb 28 at 6:51

2 Answers 2

First, your nginx has to be compiled with --with-debug configure option. If you're using freebsd ports you'd do add something like

CONFIGURE_ARGS+= --with-debug

To the Makefile in nginx's ports directory.

Then, in nginx.conf

worker_rlimit_core  2048M;
working_directory   /path/to/cores/;

in nginx.conf

and in /etc/sysctl.conf

kern.coredump=1
kern.corefile=/path/to/cores

(or "systctl -w kern-.coredump=1; sysctl kern.corefile=/path/to/cores")

Also make sure /etc/login.conf has appropriate permissions to generate cores for the user nginx runs as (typically a :coredumpsize=unlimited:, although you might want to restrict this). The nginx user will run under the "default" login class unless one is explicitly specified in /etc/master.passwd

share|improve this answer
1  
Although it's hard to tell, I think they are talking about the FCGI application crashing, not nginx. –  sciurus Feb 20 at 3:53
    
As he already sugested, not nginx is Crashing, My own FCGI app is crashing which gets served by nginx. But the point is, In the folder where the executed fcgi binary file no core file gets generated. And no where else I was able to find a config about core path or any fcgi related folder containing a core file. –  Zaibis Feb 20 at 6:42
    
If kern.coredump is other than 1, nothing will dump cores. If it's not the nginx core you're after, you may need additional configuration for whatever application is actually executing your CGI (the interpreter, I imagine), or maybe not - some (most) will do it on a segfault. –  quadruplebucky Feb 20 at 7:36
    
I said already that other applications do so. I checked already kern.coredump before and it is 1. As otherwise there wouldn't be a corefile generated by other programms. would it? –  Zaibis Feb 20 at 7:40
    
Maybe the dump it's trying to generate exceeds limits. Maybe it doesn't have write permission to where it's default location would be. I don't know, there are a lot of variables, I'm just suggesting some you definitely want to control. –  quadruplebucky Feb 20 at 7:53
up vote 0 down vote accepted

I figured out how to solve the problem by my self.

I don't know why this is necessary, but I had to change the owner of the binary file from root, to the user which is spawn-fcgi running my app with. and now it generates a core file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.