Enable core dumps with apache, RHEL5
- July 6th, 2009
- By jrod
- Write comment
If you are like me, you had some trouble getting apache to dump core on a RHEL5 system. The following steps have produced positive results for me:
echo "ulimit -c unlimited >/dev/null 2>&1" >> /etc/profile echo "DAEMON_COREFILE_LIMIT='unlimited'" >> /etc/sysconfig/init echo 1 > /proc/sys/fs/suid_dumpable echo "core.%p" > /proc/sys/kernel/core_pattern echo "CoreDumpDirectory /var/apache-core-dumps" > \ /etc/httpd/conf.d/core_dumps.conf mkdir /var/apache-core-dumps chown apache: /var/apache-core-dumps source /etc/profile /etc/init.d/httpd restart
Now you can test it by sending a SIGSEGV to a random apache child process:
# tail -f /var/log/httpd/error_log | grep -i seg & # ps auxwww |grep httpd (pick a random pid not owned by root) # kill -11 2014 # [Mon Jul 06 21:05:39 2009] [notice] child pid 2014 exit signal Segmentation fault (11), possible coredump in /var/apache-core-dumps # cd /var/apache-core-dumps # ls core.2014
You can then get a backtrace using gdb:
# gdb /usr/sbin/httpd core.2014 (gdb) > bt full
I hope this helps someone. Please feel free to comment.
