Automatically raise the core file size limit if CoreDumpDirectory is configured. --- httpd-2.0.48/server/core.c.corelimit +++ httpd-2.0.48/server/core.c @@ -4424,6 +4424,25 @@ ap_setup_make_content_type(pconf); ap_setup_auth_internal(ptemp); ap_setup_ssl_optional_fns(pconf); + +#ifdef RLIMIT_CORE + if (ap_coredumpdir_configured) { + struct rlimit lim; + + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) { + lim.rlim_cur = lim.rlim_max; + if (setrlimit(RLIMIT_CORE, &lim) == 0) { + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, + "core dump file size limit raised to %lu bytes", + lim.rlim_cur); + } else { + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL, + "core dump file size is zero, setrlimit failed"); + } + } + } +#endif + if (!sys_privileges) { ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO(00136) "Server MUST relinquish startup privileges before "