migration if resources (such as maps or certificates) are in a path
containing the branch number.
+The following variables may be read by haproxy to adjust its behavior:
+
+ * HAPROXY_FORCE_DUMPABLE: this allows to preset the equivalent of what the
+ global "set-dumpable" directive does, without having to touch the
+ configuration. This is essentially used with reg tests. The recognized
+ values are:
+ - libs: a copy of all dependencies is loaded into memory so as to be
+ preserved in core dumps
+ - off: does not enable dumpable (default)
+ - any other value (e.g. "on", "1", empty): enables set-dumpable, i.e.
+ will disable automatic chroot and try hard to enable core dumps.
+
In addition, some pseudo-variables are internally resolved and may be used as
regular variables. Pseudo-variables always start with a dot ('.'), and are the
only ones where the dot is permitted. The current list of pseudo-variables is:
the issue. When trying to enable this option waiting for a rare issue to
re-appear, it's often a good idea to first try to obtain such a dump by
issuing, for example, "kill -11" to the "haproxy" process and verify that it
- leaves a core where expected when dying.
+ leaves a core where expected when dying. Note that when debugging certain
+ setups, it is not necessarily convenient to modify the configuration nor the
+ command line to enable core dumps. This is for example the case with
+ generated configurations and regression testing. In this case, it is possible
+ to preset the set-dumpable argument in the HAPROXY_FORCE_DUMPABLE environment
+ variable, which accepts the same values.
set-var <var-name> <expr>
Sets the process-wide variable '<var-name>' to the result of the evaluation
the output queues were full and packets had to be dropped. When using TCP it
should be very rare, but will possibly indicate a saturated outgoing link.
+For more advanced debugging (e.g. crashes), core dumps might be needed. The
+global "set-dumpable" directive helps to re-enable them despite certain uid/gid
+and chroot changes. When editing the configuration is not an option, such as
+when dealing with generated configurations or regression tests, it is possible
+to set the HAPROXY_FORCE_DUMPABLE environment variable to one of the values
+accepted by "set-dumpable". Please consult the configuration manual for more
+information on this topic.
+
13. Security considerations
---------------------------
*/
static void init_early(int argc, char **argv)
{
+ const char *dumpable;
char *tmp;
int len;
ha_alert("Cannot allocate memory for log_tag.\n");
exit(EXIT_FAILURE);
}
+
+ dumpable = getenv("HAPROXY_FORCE_DUMPABLE");
+ if (dumpable) {
+ /* "libs" only loads libs; "off" keeps disabled, other values enable */
+ if (strcmp(dumpable, "libs") == 0)
+ global.tune.options |= GTUNE_SET_DUMPABLE | GTUNE_COLLECT_LIBS;
+ else if (strcmp(dumpable, "off") != 0)
+ global.tune.options |= GTUNE_SET_DUMPABLE;
+ }
}
void haproxy_init_args(int argc, char **argv)