]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: startup: also disable strict limits with -d
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Nov 2026 14:22:06 +0000 (15:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 Nov 2026 14:24:56 +0000 (15:24 +0100)
With commit 62c0c84b81 ("MINOR: init: automatically turn
"set-dumpable" on when using "-d""), an interesting issue arrived:
if started as an unprivileged user with ulimit -c forced to zero,
then an error is reported saying it's not possible to raise the
limit, and the process fails to start. This is ridiculous but logical
and can easily be dealt with because this only happens when the
strict-limits are set. Let's have -d also turn the strict limits off.

No backport is needed.

src/haproxy.c

index 00adee27ce0ca30817904ee3238a82886de3036a..213f438dd5ec934bf0e063ab9d5fcab89b4685ea 100644 (file)
@@ -1888,9 +1888,13 @@ static void init_args(int argc, char **argv)
 
        haproxy_init_args(argc, argv);
 
-       /* always enable dumpable mode in debug mode (-d) */
-       if (arg_mode & MODE_DEBUG)
+       /* always enable dumpable mode in debug mode (-d), but do not fail on
+        * limits.
+        */
+       if (arg_mode & MODE_DEBUG) {
                global.tune.options |= GTUNE_SET_DUMPABLE;
+               global.tune.options &= ~GTUNE_STRICT_LIMITS;
+       }
 }
 
 /* call the various keyword dump functions based on the comma-delimited list of