LFD Restart Bug for cPanel Version Checking
Posted: 12 Apr 2016, 18:50
So this has started hitting us after the latest update (v8.20).
What is happening is that our LFD is stuck in a restart loop. This is due to a misconfiguration in the csf.conf value GENERIC on our side combined with a logic error in lfd.pl. We had this value set to 1 (probably due to our use of clustering and it copying from a server that didn't have cPanel installed).
What occurs is that when GENERIC is set to 1 the value of $cpconfig{version} does not get populated (it ends up blank) on line 186, however in csfcheck() there is no check for $config{GENERIC} so the system ends up comparing the current cpanel version against the variable $cpconfig{version} which is blank. This causes LFD to believe that cpanel has been upgraded, and issues a restart of CSF and LFD.
I am not sure how you want to correct this issue, either a check of GENERIC in csfcheck() or a bounds check on $cpconfig{version} to ensure that it isn't blank.
On our side, we have been setting GENERIC to 0 on servers that encounter the issue, and it corrects the issue, but I suspect that we might not be the only ones encountering this.
Maybe a better approach is to throw an error that indicates that GENERIC is set to 1 but a control panel is detected, or something similar. Not 100% sure.
What is happening is that our LFD is stuck in a restart loop. This is due to a misconfiguration in the csf.conf value GENERIC on our side combined with a logic error in lfd.pl. We had this value set to 1 (probably due to our use of clustering and it copying from a server that didn't have cPanel installed).
What occurs is that when GENERIC is set to 1 the value of $cpconfig{version} does not get populated (it ends up blank) on line 186, however in csfcheck() there is no check for $config{GENERIC} so the system ends up comparing the current cpanel version against the variable $cpconfig{version} which is blank. This causes LFD to believe that cpanel has been upgraded, and issues a restart of CSF and LFD.
I am not sure how you want to correct this issue, either a check of GENERIC in csfcheck() or a bounds check on $cpconfig{version} to ensure that it isn't blank.
On our side, we have been setting GENERIC to 0 on servers that encounter the issue, and it corrects the issue, but I suspect that we might not be the only ones encountering this.
Maybe a better approach is to throw an error that indicates that GENERIC is set to 1 but a control panel is detected, or something similar. Not 100% sure.