Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 55ebb07cc57854cbfb372c3a688365039b809bc8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 3 | Date: Tue, 17 Jul 2012 11:27:39 +0100 |
| 4 | Subject: [PATCH] apache2: add from OE-Classic, update to version 2.4.2 and fix |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | |
| 6 | Bump up the core size limit if CoreDumpDirectory is |
| 7 | configured. |
| 8 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 9 | Upstream-Status: Pending |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 10 | |
| 11 | Note: upstreaming was discussed but there are competing desires; |
| 12 | there are portability oddities here too. |
| 13 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 14 | --- |
| 15 | server/core.c | 19 +++++++++++++++++++ |
| 16 | 1 file changed, 19 insertions(+) |
| 17 | |
| 18 | diff --git a/server/core.c b/server/core.c |
| 19 | index 4af0816..4fd2b9f 100644 |
| 20 | --- a/server/core.c |
| 21 | +++ b/server/core.c |
| 22 | @@ -4940,6 +4940,25 @@ static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 23 | } |
| 24 | apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper, |
| 25 | apr_pool_cleanup_null); |
| 26 | + |
| 27 | +#ifdef RLIMIT_CORE |
| 28 | + if (ap_coredumpdir_configured) { |
| 29 | + struct rlimit lim; |
| 30 | + |
| 31 | + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) { |
| 32 | + lim.rlim_cur = lim.rlim_max; |
| 33 | + if (setrlimit(RLIMIT_CORE, &lim) == 0) { |
| 34 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, |
| 35 | + "core dump file size limit raised to %lu bytes", |
| 36 | + lim.rlim_cur); |
| 37 | + } else { |
| 38 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL, |
| 39 | + "core dump file size is zero, setrlimit failed"); |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | +#endif |
| 44 | + |
| 45 | return OK; |
| 46 | } |
| 47 | |