Enable coredumps on Linux 2.4+ if CoreDumpDirectory is coded
I tried to clarify the doc, but it still looks like geek-speak. Any ideas
on how to better explain this to users would be appreciated.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@99856
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.46
+ *) Linux 2.4+: If Apache is started as root and you code
+ CoreDumpDirectory, coredumps are enabled via the prctl() syscall.
+ [Greg Ames]
+
*) ap_get_mime_headers_core: allocate space for the trailing null
when folding is in effect.
PR 18170 [Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>]
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2003/05/15 18:08:38 $]
+Last modified at [$Date: 2003/05/15 20:28:16 $]
Release:
(above) will look at this independently
DELETE ME when the SSLC 2.3 compatibility entry above is removed
- * Enable coredumps on Linux 2.4+ if CoreDumpDirectory is coded
- os/unix/unixd.c r1.57
- configure.in r1.245
- docs/manual/mod/mpm_common.xml r1.23
- include/mpm_common.h r1.41
- server/mpm_common.c r1.104
- +1: gregames, trawick, jim, nd
- (trawick volunteers to regenerate/commit/site-update the html
- corresponding to mpm_common.xml if that isn't something you're
- comfortable with doing)
- (the docs should explain the thing better. Currently it's not
- really understandable for users. If nobody else does, nd tries to.)
-
* Ensure that ssl-std.conf is generated at configure time, and switch
to using the expanded config variables to work the same as
httpd-std.conf PR: 19611
pwd.h \
grp.h \
strings.h \
+sys/prctl.h \
sys/processor.h \
sys/sem.h
)
getgrnam \
initgroups \
bindprocessor \
+prctl \
timegm \
)
*/
#ifdef AP_MPM_WANT_SET_COREDUMPDIR
extern char ap_coredump_dir[MAX_STRING_LEN];
+extern int ap_coredumpdir_configured;
const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
const char *arg);
#endif
#ifdef HAVE_SYS_SEM_H
#include <sys/sem.h>
#endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
unixd_config_rec unixd_config;
(long) unixd_config.user_id);
return -1;
}
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* this applies to Linux 2.4+ */
+#ifdef AP_MPM_WANT_SET_COREDUMPDIR
+ if (ap_coredumpdir_configured) {
+ if (prctl(PR_SET_DUMPABLE, 1)) {
+ ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
+ "set dumpable failed - this child will not coredump"
+ " after software errors");
+ }
+ }
+#endif
+#endif
#endif
return 0;
}
#ifdef AP_MPM_WANT_SET_COREDUMPDIR
char ap_coredump_dir[MAX_STRING_LEN];
+int ap_coredumpdir_configured;
const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
const char *arg)
" is not a directory", NULL);
}
apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
+ ap_coredumpdir_configured = 1;
return NULL;
}
#endif