From 256840af902b28087cd2b5c829c71b22714e7033 Mon Sep 17 00:00:00 2001 From: Michele Di Maria Date: Thu, 9 Feb 2012 20:19:28 +0100 Subject: Improvements for stability and optimizazions - Improved the reception of data from LCDd. Now there's a cycle that run until there's no more data do receive. Before that there was the possibility of a buffer overflow in LCDd. The timeout of the receiving socket is 25ms. - Optimized the number of commands sent to LCDd every cycle. Now it is sent only the half; - Rewritten with better code the error handling; - Increased to 3 the number of attempts the client performs to reconnect to LCDd in case of disconnection; - Simplified the startup scripts. Now lcdproc_client.sh is not generated/run anymore, since the error handling is managed by the client; - Changed the startup scripts to run both LCDd then the client as "nice" process; - Capped the wait time between each client cycle to 5 seconds. It still is calculated as the refresh frequency * the number of screen activated, but now it's capped; - Increased to 8000 chars the trunk of data received from LCDd; - Improved the "service stop" script. Now it cycle until LCDd is definitely killed and works even if LCDd is hung; - Added a "welcome" string on the panel at the LCDd startup; Thanks, Michele --- config/lcdproc-dev/lcdproc.inc | 46 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'config/lcdproc-dev/lcdproc.inc') diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index 0f40be53..4034248d 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -2,7 +2,8 @@ /* $Id$ */ /* lcdproc.inc - Copyright (C) 2007 Seth Mos + Copyright (C) 2007 Seth Mos , + Copyright (C) 2012 Michele Di Maria All rights reserved. Redistribution and use in source and binary forms, with or without @@ -31,7 +32,6 @@ require_once("service-utils.inc"); /* LCDproc */ define('LCDPROC_RCFILE', '/usr/local/etc/rc.d/lcdproc.sh'); - define('LCDPROC_CLIENT', '/tmp/lcdclient.sh'); define('LCDPROC_CONFIG','/usr/local/etc/LCDd.conf'); define('LCDPROC_HOST','localhost'); define('LCDPROC_PORT','13666'); @@ -228,19 +228,18 @@ return; } $config_text = "[server]\n"; + $config_text .= "DriverPath=/usr/local/lib/lcdproc/\n"; $config_text .= "Driver={$lcdproc_config[driver]}\n"; $config_text .= "Bind=127.0.0.1\n"; $config_text .= "Port=13666\n"; $config_text .= "ReportLevel=3\n"; $config_text .= "ReportToSyslog=yes\n"; - $config_text .= "WaitTime={$lcdproc_config[refresh_frequency]}\n"; $config_text .= "User=nobody\n"; + $config_text .= "Foreground=no\n"; $config_text .= "ServerScreen=no\n"; - $config_text .= "Foreground=no\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"; + $config_text .= "WaitTime={$lcdproc_config[refresh_frequency]}\n"; if ($lcdproc_config[backlight] != "" && $lcdproc_config[backlight] != "default") { /* Backlight setting */ @@ -499,34 +498,24 @@ $port_speed = $lcdproc_config[port_speed]; $config_text .= "Speed={$port_speed}\n"; } - /* generate rc file start and stop */ - $client_script = << 'lcdproc.sh', @@ -552,7 +541,6 @@ EOD; stop_service(LCDPROC_SERVICE_NAME); conf_mount_rw(); unlink(LCDPROC_RCFILE); - unlink(LCDPROC_CLIENT); unlink(LCDPROC_CONFIG); conf_mount_ro(); } -- cgit v1.2.3