From e7192dee6229c4f17afdcdb0f80b2a8b5aa5a513 Mon Sep 17 00:00:00 2001 From: Michele Di Maria Date: Wed, 1 Feb 2012 22:22:43 +0100 Subject: - Added a 20ms delay between each command sent from the client to LCDproc. - Better managed errors. Now the client resets the error counter every successful communication session with LCDproc (before was a global counter). The error counter is managed inside the client (lcdproc_client.php). - Because of the above change, now the "client script" (lcdclient.sh) do not cycle anymore. --- config/lcdproc-dev/lcdproc.inc | 12 +++-------- config/lcdproc-dev/lcdproc.xml | 4 ++-- config/lcdproc-dev/lcdproc_client.php | 39 ++++++++++++++++++++++++++-------- config/lcdproc-dev/lcdproc_screens.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 6 files changed, 38 insertions(+), 23 deletions(-) diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index 3d0a7e69..7617e168 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -237,7 +237,7 @@ $config_text .= "User=nobody\n"; $config_text .= "ServerScreen=no\n"; $config_text .= "Foreground=no\n"; - $config_text .= "TitleSpeed=10\n"; + $config_text .= "TitleSpeed=5\n"; $config_text .= "DriverPath=/usr/local/lib/lcdproc/\n"; $config_text .= "GoodBye=\"Thanks for using\"\n"; $config_text .= "GoodBye=\" {$g['product_name']} \"\n"; @@ -502,14 +502,8 @@ /* generate rc file start and stop */ $client_script = << - Services: LCDproc 0.5.5 pkg v. 0.9 + Services: LCDproc 0.5.5 pkg v. 0.9.1 lcdproc - 0.5.5 pkg v. 0.9 + 0.5.5 pkg v. 0.9.1 Save /usr/local/pkg/lcdproc.inc diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php index d931b9d0..36bf63fe 100644 --- a/config/lcdproc-dev/lcdproc_client.php +++ b/config/lcdproc-dev/lcdproc_client.php @@ -399,6 +399,7 @@ /* Define functions */ function send_lcd_commands($lcd, $lcd_cmds) { + global $lcdproc_connect_errors; if(!is_array($lcd_cmds) || (empty($lcd_cmds))) { lcdproc_warn("Failed to interpret lcd commands"); return; @@ -407,13 +408,16 @@ $cmd_output = ""; if(! fwrite($lcd, "$lcd_cmd\n")) { lcdproc_warn("Connection to LCDd process lost $errstr ($errno)"); - die(); + $lcdproc_connect_errors++; + return; } + usleep(20); // waits 20ms $cmd_output = fgets($lcd, 256); // FIXME: add support for interpreting menu commands here. if(preg_match("/^huh?/", $cmd_output)) { lcdproc_notice("LCDd output: \"$cmd_output\". Executed \"$lcd_cmd\""); } + $lcdproc_connect_errors = 0; // Reset the error counter } } @@ -722,6 +726,7 @@ function loop_status($lcd) { global $g; global $config; + global $lcdproc_connect_errors; $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; $lcdpanel_width = get_lcdpanel_width(); $lcdpanel_height = get_lcdpanel_height(); @@ -874,7 +879,12 @@ add_summary_values($lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width); } } + $temp_lcdproc_connect_errors = $lcdproc_connect_errors; send_lcd_commands($lcd, $lcd_cmds); + if ($temp_lcdproc_connect_errors != $lcdproc_connect_errors) + { //an error occurred + return; + } sleep($refresh_frequency * $widget_counter); $i++; } @@ -883,14 +893,25 @@ $traffic_last_ugmt = 0; $traffic_last_ifin = 0; $traffic_last_ifout = 0; + /* Initialize the global error counter */ + $lcdproc_connect_errors = 0; + $lcdproc_max_connect_errors = 2; /* Connect to the LCDd port and interface with the LCD */ - $lcd = fsockopen(LCDPROC_HOST, LCDPROC_PORT, $errno, $errstr, 10); - if (!$lcd) { - lcdproc_warn("Failed to connect to LCDd process $errstr ($errno)"); - } else { - build_interface($lcd); - loop_status($lcd); - /* loop exited? Close fd and wait for the script to kick in again */ - fclose($lcd); + while ($lcdproc_connect_errors <= $lcdproc_max_connect_errors) + { + lcdproc_warn("Start client procedure. Error counter: ($lcdproc_connect_errors)"); + $lcd = fsockopen(LCDPROC_HOST, LCDPROC_PORT, $errno, $errstr, 10); + if (!$lcd) { + lcdproc_warn("Failed to connect to LCDd process $errstr ($errno)"); + $lcdproc_connect_errors++; + } else { + build_interface($lcd); + loop_status($lcd); + fclose($lcd); + } + } + if ($lcdproc_connect_errors >= $lcdproc_max_connect_errors) + { + lcdproc_warn("Too many errors, the client ends."); } ?> \ No newline at end of file diff --git a/config/lcdproc-dev/lcdproc_screens.xml b/config/lcdproc-dev/lcdproc_screens.xml index b49018e3..3dfe4b75 100644 --- a/config/lcdproc-dev/lcdproc_screens.xml +++ b/config/lcdproc-dev/lcdproc_screens.xml @@ -2,7 +2,7 @@ Services: LCDproc: Screens lcdproc_screens - 0.5.5 pkg v. 0.9 + 0.5.5 pkg v. 0.9.1 Save /usr/local/pkg/lcdproc.inc diff --git a/pkg_config.8.xml b/pkg_config.8.xml index e61c6e5d..4597463e 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1023,7 +1023,7 @@ LCD display driver - Development version http://www.lcdproc.org/ Utility - lcdproc-0.5.5 pkg v. 0.9 + lcdproc-0.5.5 pkg v. 0.9.1 BETA 2.0 michele@nt2.it diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index cda307dc..9dfcee33 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -989,7 +989,7 @@ LCD display driver - Development version http://www.lcdproc.org/ Utility - lcdproc-0.5.5 pkg v. 0.9 + lcdproc-0.5.5 pkg v. 0.9.1 BETA 2.0 michele@nt2.it -- cgit v1.2.3 From 2bb724fbd70daf03b6e94563ba509bd32355d7fd Mon Sep 17 00:00:00 2001 From: Michele Di Maria Date: Wed, 1 Feb 2012 22:51:23 +0100 Subject: Kills explicitly the clients on the package resync --- config/lcdproc-dev/lcdproc.inc | 4 ++++ config/lcdproc-dev/lcdproc.xml | 4 ++-- config/lcdproc-dev/lcdproc_screens.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index 7617e168..0f40be53 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -512,6 +512,10 @@ if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0 ]; then ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill -9 sleep 1 fi +if [ `ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'| wc -l` != 0 ]; then + ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs kill -9 + sleep 1 +fi if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill -9 sleep 1 diff --git a/config/lcdproc-dev/lcdproc.xml b/config/lcdproc-dev/lcdproc.xml index 0ef98694..07d19816 100644 --- a/config/lcdproc-dev/lcdproc.xml +++ b/config/lcdproc-dev/lcdproc.xml @@ -1,8 +1,8 @@ - Services: LCDproc 0.5.5 pkg v. 0.9.1 + Services: LCDproc 0.5.5 pkg v. 0.9.2 lcdproc - 0.5.5 pkg v. 0.9.1 + 0.5.5 pkg v. 0.9.2 Save /usr/local/pkg/lcdproc.inc diff --git a/config/lcdproc-dev/lcdproc_screens.xml b/config/lcdproc-dev/lcdproc_screens.xml index 3dfe4b75..46bde743 100644 --- a/config/lcdproc-dev/lcdproc_screens.xml +++ b/config/lcdproc-dev/lcdproc_screens.xml @@ -2,7 +2,7 @@ Services: LCDproc: Screens lcdproc_screens - 0.5.5 pkg v. 0.9.1 + 0.5.5 pkg v. 0.9.2 Save /usr/local/pkg/lcdproc.inc diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 4597463e..e2c4fbdc 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1023,7 +1023,7 @@ LCD display driver - Development version http://www.lcdproc.org/ Utility - lcdproc-0.5.5 pkg v. 0.9.1 + lcdproc-0.5.5 pkg v. 0.9.2 BETA 2.0 michele@nt2.it diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 9dfcee33..4d0b934b 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -989,7 +989,7 @@ LCD display driver - Development version http://www.lcdproc.org/ Utility - lcdproc-0.5.5 pkg v. 0.9.1 + lcdproc-0.5.5 pkg v. 0.9.2 BETA 2.0 michele@nt2.it -- cgit v1.2.3 From bc1438b33713122884f6112a95bc43f1d3e0d77d Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Thu, 2 Feb 2012 22:52:50 +0100 Subject: change default value because most people use it --- config/freeradius2/freeradiussettings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/freeradius2/freeradiussettings.xml b/config/freeradius2/freeradiussettings.xml index f31545e1..edb51a8b 100644 --- a/config/freeradius2/freeradiussettings.xml +++ b/config/freeradius2/freeradiussettings.xml @@ -302,7 +302,8 @@ Disable Acct_Unique varsettingsenableacctunique - + + on checkbox -- cgit v1.2.3 From 4629660ec083db52cf1faf2b8bc393bb5fd6d371 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 2 Feb 2012 22:02:17 +0000 Subject: Bump package version on snort to match latest changes --- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index e2c4fbdc..346be5f7 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -350,7 +350,7 @@ Security http://files.pfsense.org/packages/8/All/ mysql-client-5.1.53.tbz - snort-2.9.0.5.tbz + snort-2.9.0.5_1.tbz perl-threaded-5.10.1_3.tbz /usr/ports/devel/pcre /usr/ports/net/daq diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 4d0b934b..dab31a17 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -433,7 +433,7 @@ http://files.pfsense.org/packages/amd64/8/All/ snort-2.9.1-amd64.pbi mysql-client-5.1.53.tbz - snort-2.9.0.5.tbz + snort-2.9.0.5_1.tbz perl-threaded-5.10.1_3.tbz /usr/ports/devel/pcre /usr/ports/net/daq -- cgit v1.2.3 From 5f0b221e5ec08527319196cf1f5eac71e5a88950 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Fri, 3 Feb 2012 19:37:33 +0100 Subject: reverted commit from yesterday --- config/freeradius2/freeradiussettings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/freeradius2/freeradiussettings.xml b/config/freeradius2/freeradiussettings.xml index edb51a8b..0325ba53 100644 --- a/config/freeradius2/freeradiussettings.xml +++ b/config/freeradius2/freeradiussettings.xml @@ -303,7 +303,6 @@ Disable Acct_Unique varsettingsenableacctunique - on checkbox -- cgit v1.2.3