Sean’s Obsessions

Sean Walberg’s blog

Finally, Getting Apache to Core

I’ve had some problems with Apache and I’d like a core dump when it happens so I can get a backtrace.

It’s harder than you think. Red Hat has 2 documents on it: this and that.

The summary of those is to add

CoreDumpDirectory /var/apache-dump

to httpd.conf, and make that directory 777. Then, edit some startup scripts to run ulimit -n unlimited.

What I had to do to get it working was:

/etc/sysctl.conf:
kernel.suid_dumpable = 1
kernel.core_pattern = /var/apache-dump/%e-%t-%p

to get it to work.

As an aside, the ulimit -c unlimited hacks seems unnecessary, you can add

DAEMON_COREFILE_LIMIT=999999999

(or possibly even “unlimited” ) to /etc/sysconfig/httpd, as part of /etc/init.d/functions checks that (that goes for any service, too)

Comments

I’m trying something new here. Talk to me on Twitter with the button above, please.