[Remove entries to the current 2.0 section below, when backported]
+ *) Linux 2.4+: enable coredumps when Apache is started as root
+ if CoreDumpDir is configured [Greg Ames]
+
*) you can now specify the compression level for mod_deflate.
[Ian Holsman, Stephen Pierzchala <stephen@pierzchala.com>,
Michael Schroepl <Michael.Schroepl@telekurs.de>]
pwd.h \
grp.h \
strings.h \
+sys/prctl.h \
sys/processor.h \
sys/sem.h
)
getgrnam \
initgroups \
bindprocessor \
+prctl \
timegm \
)
as, core dumps won't normally get written. If you want a core
dump for debugging, you can use this directive to place it in a
different location.</p>
+ <p>Linux 2.4 and beyond: If you start Apache as root and you
+ explicitly code CoreDumpDirectory, Apache enables core dumps.</p>
</usage>
</directivesynopsis>
*/
#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