}
}
- /* try our best to re-enable core dumps depending on system capabilities.
- * What is addressed here :
- * - remove file size limits
- * - remove core size limits
- * - mark the process dumpable again if it lost it due to user/group
- */
- if (global.tune.options & GTUNE_SET_DUMPABLE) {
- limit.rlim_cur = limit.rlim_max = RLIM_INFINITY;
-
-#if defined(RLIMIT_FSIZE)
- if (setrlimit(RLIMIT_FSIZE, &limit) == -1) {
- if (global.tune.options & GTUNE_STRICT_LIMITS) {
- ha_alert("[%s.main()] Failed to set the raise the maximum "
- "file size.\n", argv[0]);
- if (!(global.mode & MODE_MWORKER))
- exit(1);
- }
- else
- ha_warning("[%s.main()] Failed to set the raise the maximum "
- "file size. This will fail in >= v2.3\n", argv[0]);
- }
-#endif
-
-#if defined(RLIMIT_CORE)
- if (setrlimit(RLIMIT_CORE, &limit) == -1) {
- if (global.tune.options & GTUNE_STRICT_LIMITS) {
- ha_alert("[%s.main()] Failed to set the raise the core "
- "dump size.\n", argv[0]);
- if (!(global.mode & MODE_MWORKER))
- exit(1);
- }
- else
- ha_warning("[%s.main()] Failed to set the raise the core "
- "dump size. This will fail in >= v2.3\n", argv[0]);
- }
-#endif
-
-#if defined(USE_PRCTL)
- if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1)
- ha_warning("[%s.main()] Failed to set the dumpable flag, no core will be dumped.\n", argv[0]);
-#endif
- }
-
/* check ulimits */
limit.rlim_cur = limit.rlim_max = 0;
getrlimit(RLIMIT_NOFILE, &limit);
fork_poller();
}
+ /* try our best to re-enable core dumps depending on system capabilities.
+ * What is addressed here :
+ * - remove file size limits
+ * - remove core size limits
+ * - mark the process dumpable again if it lost it due to user/group
+ */
+ if (global.tune.options & GTUNE_SET_DUMPABLE) {
+ limit.rlim_cur = limit.rlim_max = RLIM_INFINITY;
+
+#if defined(RLIMIT_FSIZE)
+ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) {
+ if (global.tune.options & GTUNE_STRICT_LIMITS) {
+ ha_alert("[%s.main()] Failed to set the raise the maximum "
+ "file size.\n", argv[0]);
+ if (!(global.mode & MODE_MWORKER))
+ exit(1);
+ }
+ else
+ ha_warning("[%s.main()] Failed to set the raise the maximum "
+ "file size. This will fail in >= v2.3\n", argv[0]);
+ }
+#endif
+
+#if defined(RLIMIT_CORE)
+ if (setrlimit(RLIMIT_CORE, &limit) == -1) {
+ if (global.tune.options & GTUNE_STRICT_LIMITS) {
+ ha_alert("[%s.main()] Failed to set the raise the core "
+ "dump size.\n", argv[0]);
+ if (!(global.mode & MODE_MWORKER))
+ exit(1);
+ }
+ else
+ ha_warning("[%s.main()] Failed to set the raise the core "
+ "dump size. This will fail in >= v2.3\n", argv[0]);
+ }
+#endif
+
+#if defined(USE_PRCTL)
+ if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1)
+ ha_warning("[%s.main()] Failed to set the dumpable flag, "
+ "no core will be dumped.\n", argv[0]);
+#endif
+ }
+
global.mode &= ~MODE_STARTING;
/*
* That's it : the central polling loop. Run until we stop.