]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: support explicit "on" and "off" for "set-dumpable"
authorWilly Tarreau <w@1wt.eu>
Wed, 18 Mar 2026 09:39:30 +0000 (10:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 Mar 2026 14:30:39 +0000 (15:30 +0100)
The global "set-dumpable" keyword currently is only positional. Let's
extend its syntax to support arguments. For now we support both "on"
and "off" to explicitly enable or disable it.

doc/configuration.txt
src/cfgparse-global.c

index a1cfd032c1c7bdbea2c46736579c93bd64eb62af..fd60f42052b340ae07e761cd513abdf914871e9a 100644 (file)
@@ -3148,10 +3148,11 @@ server-state-file <file>
   configuration. See also "server-state-base" and "show servers state",
   "load-server-state-from-file" and "server-state-file-name"
 
-set-dumpable
+set-dumpable [ on | off ]
   This option is better left disabled by default and enabled only upon a
-  developer's request. If it has been enabled, it may still be forcibly
-  disabled by prefixing it with the "no" keyword. It has no impact on
+  developer's request. By default it is disabled. Without argument, it defaults
+  to "on". If it has been enabled, it may still be forcibly disabled by prefixing
+  it with the "no" keyword or by setting it to "off". It has no impact on
   performance nor stability but will try hard to re-enable core dumps that were
   possibly disabled by file size limitations (ulimit -f), core size limitations
   (ulimit -c), or "dumpability" of a process after changing its UID/GID (such
index 81616c218d021da36ae2523803610a4aa79070f5..f1c4b7a17a9fb3e04db24eec0e786e5d502df141 100644 (file)
@@ -89,12 +89,21 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                        global.tune.options |=  GTUNE_BUSY_POLLING;
        }
        else if (strcmp(args[0], "set-dumpable") == 0) { /* "no set-dumpable" or "set-dumpable" */
-               if (alertif_too_many_args(0, file, linenum, args, &err_code))
+               if (alertif_too_many_args(1, file, linenum, args, &err_code))
                        goto out;
-               if (kwm == KWM_NO)
+               if (kwm == KWM_NO) {
                        global.tune.options &= ~GTUNE_SET_DUMPABLE;
-               else
-                       global.tune.options |=  GTUNE_SET_DUMPABLE;
+                       goto out;
+               }
+               if (!*args[1] || strcmp(args[1], "on") == 0)
+                       global.tune.options |= GTUNE_SET_DUMPABLE;
+               else if (strcmp(args[1], "off") == 0)
+                       global.tune.options &= ~GTUNE_SET_DUMPABLE;
+               else {
+                       ha_alert("parsing [%s:%d] : '%s' only supports 'on' and 'off' as an argument, found '%s'.\n", file, linenum, args[0], args[1]);
+                       err_code |= ERR_ALERT | ERR_FATAL;
+                       goto out;
+               }
        }
        else if (strcmp(args[0], "h2-workaround-bogus-websocket-clients") == 0) { /* "no h2-workaround-bogus-websocket-clients" or "h2-workaround-bogus-websocket-clients" */
                if (alertif_too_many_args(0, file, linenum, args, &err_code))