#include <sys/time.h>
#include <sys/resource.h>
#include <sys/mman.h>
+#include <sys/prctl.h>
#include "common.h"
#include "log.h"
struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
if(setrlimit(RLIMIT_CORE, &rl) != 0)
info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
}
// --------------------------------------------------------------------
exit(1);
}
+ if(debug_flags != 0) {
+ struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
+ if(setrlimit(RLIMIT_CORE, &rl) != 0)
+ info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
+
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+ }
+
if(output_log_syslog || error_log_syslog || access_log_syslog)
openlog("netdata", LOG_PID, LOG_DAEMON);