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?
First, your nginx has to be compiled with --with-debug configure option. If you're using freebsd ports you'd do add something like
To the Makefile in nginx's ports directory.
Then, in nginx.conf
and in /etc/sysctl.conf
(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
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.