Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > a59d99d921b61531305538efcdff3a64 > files > 34

apache-2.2.24-1.1.mga2.src.rpm


Automatically raise the core file size limit if CoreDumpDirectory
is configured.

Upstream-HEAD: submitted
Upstream-Status: Not so useful on Solaris, discussed
Upstream-Discuss: http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=107831370002083&w=2

--- server/core.c	2008-06-02 23:18:18.000000000 +0200
+++ server/core.c.oden	2008-12-12 13:12:35.000000000 +0100
@@ -3777,6 +3777,25 @@ static int core_post_config(apr_pool_t *
 
     set_banner(pconf);
     ap_setup_make_content_type(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
+
     return OK;
 }