diff options
author | Ermal Luçi <eri@pfsense.org> | 2013-05-30 00:25:43 -0700 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2013-05-30 00:25:43 -0700 |
commit | dcccb98d5d9dfbf3f3e9a8a2272324dbc3e67ed8 (patch) | |
tree | f5df55c21715cc9e3437e3929e011f65a9f38b38 /config/haproxy-devel/haproxy_global.php | |
parent | 917bec0541467546dec54baba72ae99077823736 (diff) | |
parent | 0486d32f0b5f4d514f02f68c33f22f0864f20ac1 (diff) | |
download | pfsense-packages-dcccb98d5d9dfbf3f3e9a8a2272324dbc3e67ed8.tar.gz pfsense-packages-dcccb98d5d9dfbf3f3e9a8a2272324dbc3e67ed8.tar.bz2 pfsense-packages-dcccb98d5d9dfbf3f3e9a8a2272324dbc3e67ed8.zip |
Merge pull request #453 from PiBa-NL/haproxy-devel-2.1
haproxy-devel, fix required fields a shared-backend, optional Force immediate stop of old process on reload, fix show memory usage.
Diffstat (limited to 'config/haproxy-devel/haproxy_global.php')
-rwxr-xr-x | config/haproxy-devel/haproxy_global.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/config/haproxy-devel/haproxy_global.php b/config/haproxy-devel/haproxy_global.php index 7ff0fb65..dbc55847 100755 --- a/config/haproxy-devel/haproxy_global.php +++ b/config/haproxy-devel/haproxy_global.php @@ -68,6 +68,7 @@ if ($_POST) { if (!$input_errors) { $config['installedpackages']['haproxy']['enable'] = $_POST['enable'] ? true : false; + $config['installedpackages']['haproxy']['terminate_on_reload'] = $_POST['terminate_on_reload'] ? true : false; $config['installedpackages']['haproxy']['maxconn'] = $_POST['maxconn'] ? $_POST['maxconn'] : false; $config['installedpackages']['haproxy']['enablesync'] = $_POST['enablesync'] ? true : false; $config['installedpackages']['haproxy']['synchost1'] = $_POST['synchost1'] ? $_POST['synchost1'] : false; @@ -84,10 +85,10 @@ if ($_POST) { write_config(); } } - } $pconfig['enable'] = isset($config['installedpackages']['haproxy']['enable']); +$pconfig['terminate_on_reload'] = isset($config['installedpackages']['haproxy']['terminate_on_reload']); $pconfig['maxconn'] = $config['installedpackages']['haproxy']['maxconn']; $pconfig['enablesync'] = isset($config['installedpackages']['haproxy']['enablesync']); $pconfig['syncpassword'] = $config['installedpackages']['haproxy']['syncpassword']; @@ -177,9 +178,9 @@ function enable_change(enable_change) { Sets the maximum per-process number of concurrent connections to X.<br/> <strong>NOTE:</strong> setting this value too high will result in HAProxy not being able to allocate enough memory.<br/> <?php - $hascpu = trim(`top | grep haproxy | awk '{ print $6 }'`); - if($hascpu) - echo "<p>Current memory usage {$hascpu}.</p>"; + $memusage = trim(`ps auxw | grep haproxy | grep -v grep | awk '{ print $5 }'`); + if($memusage) + echo "<p>Current memory usage: {$memusage} K.</p>"; ?> </td><td> <table style="border: 1px solid #000;"> @@ -225,6 +226,15 @@ function enable_change(enable_change) { </td> </tr> <tr> + <td width="22%" valign="top" class="vncell">Reload behaviour</td> + <td width="78%" class="vtable"> + <input name="terminate_on_reload" type="checkbox" value="yes" <?php if ($pconfig['terminate_on_reload']) echo "checked"; ?>> + Force immediate stop of old process on reload. (closes existing connections)<br/><br/>Note: when this option is selected connections will be closed when haproxy is restarted. + Otherwise the existing connections will be served by the old haproxy process untill they are closed. + Checking this option will interupt existing connections on a restart. (which happens when the configuration is applied, + but possibly also when pfSense detects an interface comming up or changing its ip-address)</td> + </tr> + <tr> <td valign="top" class="vncell"> Remote syslog host </td> |