From f61970dd0b335d12430eb4d2f2e6c896df111ca4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 21 Jan 2010 11:07:25 -0500 Subject: Raise file open limits for haproxy if needed --- config/haproxy/haproxy.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index 15a5a84d..8e6984bf 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -278,7 +278,13 @@ function haproxy_configure() { // create config file fclose($fd); - exec(""); + $freebsd_version = substr(trim(`uname -r`), 0, 1); + if(!file_exists("/usr/bin/limits")) { + exec("fetch -q -o /usr/bin/limits http://files.pfsense.org/extras/{$freebsd_version}/limits"); + exec("chmod a+rx /usr/bin/limits"); + } + + exec("/usr/bin/limits -n 300014"); // reload haproxy if(isset($a_global['enable'])) { -- cgit v1.2.3