as agreed a few months ago, enable strict-limits for v2.3
update configuration manual accordingly

Signed-off-by: William Dauchy <[email protected]>
---
 doc/configuration.txt | 11 +++++------
 src/cfgparse-global.c |  2 --
 src/haproxy.c         | 17 +++++++----------
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index 8be19e369..3057d5198 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -1536,12 +1536,11 @@ wurfl-cache-size <size>
   with USE_WURFL=1.
 
 strict-limits
-  Makes process fail at startup when a setrlimit fails. Haproxy is tries to set
-  the best setrlimit according to what has been calculated. If it fails, it
-  will emit a warning. Use this option if you want an explicit failure of
-  haproxy when those limits fail. This option is disabled by default. If it has
-  been enabled, it may still be forcibly disabled by prefixing it with the "no"
-  keyword.
+  Makes process fail at startup when a setrlimit fails. Haproxy tries to set 
the
+  best setrlimit according to what has been calculated. If it fails, it will
+  emit a warning. This option is here to guarantee an explicit failure of
+  haproxy when those limits fail. It is enabled by default. It may still be
+  forcibly disabled by prefixing it with the "no" keyword.
 
 3.2. Performance tuning
 -----------------------
diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c
index 0e6905976..4c98df8e7 100644
--- a/src/cfgparse-global.c
+++ b/src/cfgparse-global.c
@@ -1196,8 +1196,6 @@ int cfg_parse_global(const char *file, int linenum, char 
**args, int kwm)
                        goto out;
                if (kwm == KWM_NO)
                        global.tune.options &= ~GTUNE_STRICT_LIMITS;
-               else
-                       global.tune.options |= GTUNE_STRICT_LIMITS;
        }
        else {
                struct cfg_kw_list *kwl;
diff --git a/src/haproxy.c b/src/haproxy.c
index 278476c3e..6f57f4cb6 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -1705,6 +1705,7 @@ static void init(int argc, char **argv)
 #if defined(SO_REUSEPORT)
        global.tune.options |= GTUNE_USE_REUSEPORT;
 #endif
+       global.tune.options |= GTUNE_STRICT_LIMITS;
 
        pid = getpid();
        progname = *argv;
@@ -3062,8 +3063,7 @@ int main(int argc, char **argv)
                                if (setrlimit(RLIMIT_NOFILE, &limit) != -1)
                                        getrlimit(RLIMIT_NOFILE, &limit);
 
-                               ha_warning("[%s.main()] Cannot raise FD limit 
to %d, limit is %d. "
-                                          "This will fail in >= v2.3\n",
+                               ha_warning("[%s.main()] Cannot raise FD limit 
to %d, limit is %d.\n",
                                           argv[0], global.rlimit_nofile, 
(int)limit.rlim_cur);
                                global.rlimit_nofile = limit.rlim_cur;
                        }
@@ -3082,8 +3082,7 @@ int main(int argc, char **argv)
                                        exit(1);
                        }
                        else
-                               ha_warning("[%s.main()] Cannot fix MEM limit to 
%d megs."
-                                          "This will fail in >= v2.3\n",
+                               ha_warning("[%s.main()] Cannot fix MEM limit to 
%d megs.\n",
                                           argv[0], global.rlimit_memmax);
                }
 #else
@@ -3095,8 +3094,7 @@ int main(int argc, char **argv)
                                        exit(1);
                        }
                        else
-                               ha_warning("[%s.main()] Cannot fix MEM limit to 
%d megs.",
-                                          "This will fail in >= v2.3\n",
+                               ha_warning("[%s.main()] Cannot fix MEM limit to 
%d megs.\n",
                                           argv[0], global.rlimit_memmax);
                }
 #endif
@@ -3282,8 +3280,7 @@ int main(int argc, char **argv)
                }
                else
                        ha_alert("[%s.main()] FD limit (%d) too low for 
maxconn=%d/maxsock=%d. "
-                                "Please raise 'ulimit-n' to %d or more to 
avoid any trouble."
-                                "This will fail in >= v2.3\n",
+                                "Please raise 'ulimit-n' to %d or more to 
avoid any trouble.\n",
                                 argv[0], (int)limit.rlim_cur, global.maxconn, 
global.maxsock,
                                 global.maxsock);
        }
@@ -3565,7 +3562,7 @@ int main(int argc, char **argv)
                        }
                        else
                                ha_warning("[%s.main()] Failed to set the raise 
the maximum "
-                                          "file size. This will fail in >= 
v2.3\n", argv[0]);
+                                          "file size.\n", argv[0]);
                }
 #endif
 
@@ -3579,7 +3576,7 @@ int main(int argc, char **argv)
                        }
                        else
                                ha_warning("[%s.main()] Failed to set the raise 
the core "
-                                          "dump size. This will fail in >= 
v2.3\n", argv[0]);
+                                          "dump size.\n", argv[0]);
                }
 #endif
 
-- 
2.25.1


Reply via email to