LCDProc fails to start after RC 23.01 Upgrade
-
After upgrading to 23.01RC from 22.05 Release, LCDProc fails to start.
PHP ERROR: Type: 1, File: /usr/local/pkg/lcdproc_client.php, Line: 1257, Message: Uncaught Error: Undefined constant "i" in /usr/local/pkg/lcdproc_client.php:1257 Stack trace: #0 /usr/local/pkg/lcdproc_client.php(1403): loop_status(Resource id #49) #1 {main}
-
Looks like there are a couple cases of that in the file, can you try this diff and see if any other errors pop up after these are fixed?
index 8344e5ed430f..e6718b8ab810 100644 --- a/a/usr/local/pkg/lcdproc_client.php +++ b/a/usr/local/pkg/lcdproc_client.php @@ -1254,7 +1254,7 @@ function loop_status($lcd) { $title = ($lcdpanel_width >= 20) ? "Interface bps IN/OUT" : "Intf. bps IN/OUT"; $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"{$title}\""; - for($i = 0; $i < ($lcdpanel_height - 1) && i < count($interfaceTrafficStrings); $i++) { + for($i = 0; $i < ($lcdpanel_height - 1) && $i < count($interfaceTrafficStrings); $i++) { $lcd_cmds[] = "widget_set $name text_wdgt{$i} 1 " . ($i + 2) . " \"{$interfaceTrafficStrings[$i]}\""; } @@ -1267,7 +1267,7 @@ function loop_status($lcd) { $title = ($lcdpanel_width >= 20) ? "Total today IN/OUT" : "Today IN / OUT"; $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"{$title}\""; - for($i = 0; $i < ($lcdpanel_height - 1) && i < count($interfaceTrafficStrings); $i++) { + for($i = 0; $i < ($lcdpanel_height - 1) && $i < count($interfaceTrafficStrings); $i++) { $lcd_cmds[] = "widget_set $name text_wdgt{$i} 1 " . ($i + 2) . " \"{$interfaceTrafficStrings[$i]}\""; } @@ -1280,7 +1280,7 @@ function loop_status($lcd) { $title = ($lcdpanel_width >= 20) ? "Total IN/OUT" : "Total IN / OUT"; $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"{$title}\""; - for($i = 0; $i < ($lcdpanel_height - 1) && i < count($interfaceTrafficStrings); $i++) { + for($i = 0; $i < ($lcdpanel_height - 1) && $i < count($interfaceTrafficStrings); $i++) { $lcd_cmds[] = "widget_set $name text_wdgt{$i} 1 " . ($i + 2) . " \"{$interfaceTrafficStrings[$i]}\""; }
I don't have any LCD panels here to test with so I can't check it directly.
You can install the System Patches package and then create an entry for that diff to apply the fix.
-
@jimp this patch appears to have resolved the issue. I'll monitor and update this post if any crashes occur.
Thank you for looking into this so quickly!
-
I committed that change to the package so when we do another build, it will be fixed there.
Thanks for testing!