Attempting to start LFD while in TESTING mode does not report the correct error "*Error* lfd will not run with TESTING enabled in /etc/csf/csf.conf". Instead, /usr/sbin/lfd attempts to close and unlink the $pidfile /var/run/lfd.pid using an undefined file handle $PIDFILE at line 7186. This causes the error: "Can't use an undefined value as a symbol reference at /usr/sbin/lfd line.7186".
Also referenced in thread: viewtopic.php?f=6&t=10867&p=29612#p29612
lfd incorrectly attempts to close and unlink pid file in TESTING mode
Re: lfd incorrectly attempts to close and unlink pid file in TESTING mode
Code: Select all
--- lfd 2018-06-24 20:02:30.524696331 +0000
+++ lfd.patched 2018-06-24 20:02:15.830848692 +0000
@@ -7183,8 +7183,11 @@
}
logfile("daemon stopped");
- close($PIDFILE);
- unlink $pidfile;
+ # If PIDFILE is not defined then LFD is not started (TESTING mode?)
+ if ( defined($PIDFILE) ) {
+ close($PIDFILE);
+ unlink $pidfile;
+ }
kill (9, -$$);