LCDProc 0.5.4-dev
-
Hi Michele, I hope you're feeling better. :)
Removing the delay(s) completely didn't work for me on my X-Core box. In fact I tried many combinations of delays in different places an failed to get a clean boot.
Steve
-
Hi Michele, I hope you're feeling better. :)
Removing the delay(s) completely didn't work for me on my X-Core box. In fact I tried many combinations of delays in different places an failed to get a clean boot.
Steve
Hi Steve,
mmhhh… I just had a clean reboot, after that the panel was working and:[2.0.1-RELEASE][root@pfsense2.domain.nt2.it]/root(18): ps -ax | grep lcd 39543 ?? SN 0:00.91 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.p 27085 v0- I 0:00.00 /bin/sh /usr/local/etc/rc.d/lcdproc.sh start 13349 0 R+ 0:00.00 grep lcd
[2.0.1-RELEASE][root@pfsense2.domain.nt2.it]/root(23): ps -ax | grep LCD 37346 ?? SNs 0:00.31 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf 7034 0 S+ 0:00.00 grep LCD
I can't find anything wrong. Also restarting the service quickly, or changing the service properties while the service is running, brings me to the above state, which is consistent.
I will investigate more, but until now the only change I did is to remove the "sleep" lines in the "lcdproc.inc" file and saving the configuration (line 506 and "a bit below").
Where did you remove "sleep" lines from?
Thanks,
Michele -
Although what I wrote above is true if you get an 'un-killable' process the main reason the lcdproc.sh remains running is that it is held open by the php call.
You need to background the process (&) like so:$start .= "\t/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &\n";
Steve
Hi Steve,
I added the & at the end of the command, and yes the lcdproc.sh is not visible anymore with ps -ax (sorry, I come from Windows and I don't know this tricks).Btw, I made different "restarts" of the service and a reboot, everything was running and there was only 1 client and 1 server running.
I don't know what is going wrong on your boxes…
Ciao,
Michele -
Where did you remove "sleep" lines from?
From lcdproc.inc as you did. I also added a "&" to the call to lcdproc_client.php as I details a few posts back.
I'll try taking that out again.Edit: You type faster than me!
I am relatively new to FreeBSD also. I only knew to do that because that's how it was called in the old Firebox tarball.
I am starting to think that a lot of this might be down to the speed of the box. The X-Core is a relatively old machine. I'll have to try it on the X-e box for comparison. Alternatively you are using a different driver, perhaps the service is able to stop and start faster?
During the boot process the the package config pages are synced. Because the lcdproc package has two pages both are synced however the lcdproc_screens.xml simply calls the lcdproc.xml sync function. This results in the sync function running twice hence the service is restarted twice. Then slight later in the boot process the WAN interface comes up and receives an IP address, this results in a call to restart all packages again.
I'll run some more tests.
Steve
-
the results were blank. I dont have anything set, left it for the system to decide. The dashboard says 299000.. I'll set a value and see what happens. Its been awhile since I looked at the lcdproc code, but I'm thinking there was default 10000 if nothing is set via the gui now that i think about it a little more
This is done, you'll find it in the next release of the package!
Ciao,
Michele -
Where did you remove "sleep" lines from?
From lcdproc.inc as you did. I also added a "&" to the call to lcdproc_client.php as I details a few posts back.
I'll try taking that out again.Edit: You type faster than me!
I am relatively new to FreeBSD also. I only knew to do that because that's how it was called in the old Firebox tarball.
I am starting to think that a lot of this might be down to the speed of the box. The X-Core is a relatively old machine. I'll have to try it on the X-e box for comparison. Alternatively you are using a different driver, perhaps the service is able to stop and start faster?
During the boot process the the package config pages are synced. Because the lcdproc package has two pages both are synced however the lcdproc_screens.xml simply calls the lcdproc.xml sync function. This results in the sync function running twice hence the service is restarted twice. Then slight later in the boot process the WAN interface comes up and receives an IP address, this results in a call to restart all packages again.
I'll run some more tests.
Steve
Hi Steve,
so good, you removed the delays exactly where I was removing them from, so nothing to say about that.If is true, the package is synced twice during the reboot, I don't know how to avoid that (without forcing a manual service restart every time someone changes a setting in the "screens" page), but I confirm you after some reboot, that on my hardware this do not give any problem (X3460 Xeon, SSD HD, Intel dual port NICs, 4GB ram, Sureelect USB panel 20x4, but ok, I understand that like this is easy, I know)…
As for my situation, I achived a total stable situation. I will release the latest changes asap...
Ciao,
Michele -
Released!
The changelog is the following:
- The Client now runs in background (added a trailing & at the end of the command that runs the client);
- Removed the delays in the script during the service stop;
- Fixed the "default max states" information when it is not defined explicitally in the advanced configuration.
Should be the most stable LCDProc ever released… hope will fix (or at least minimize) the issues on all the boxes...
Thanks,
Michele -
Nice! :)
One possible solution to the number of restarts might be to add some code to prevent a restart being called unless a change to the config has been made.
Currently:/* or restart lcdproc if settings were changed*/ if(is_service_running(LCDPROC_SERVICE_NAME)) { lcdproc_notice("Sync: Restarting the service"); restart_service(LCDPROC_SERVICE_NAME);
But in fact it restarts whether changes have been made or not.
Or possibly have two separate sync funtions, one that restarts LCDd when you sync lcdproc.xml and one the restarts the lcdproc_client.php when you sync lcdproc_screens.xml.
Maybe just something like this:
Replace:function sync_package_lcdproc_screens() { sync_package_lcdproc(); }
With:
function sync_package_lcdproc_screens() { if(is_service_running(LCDPROC_SERVICE_NAME)) { lcdproc_notice("Sync: Restart PHP Client"); mwexec("ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs kill"); mwexec("/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &"); } }
That would at least reduce the times LCDd is restarted. I don't know if it actually has to do any syncing or whether that's all handled by the pfSense package system. ::)
Steve
-
Unfortunately it's not booting cleanly on the X-Core box. Imdediately after boot:
[2.0.1-RELEASE][root@x-core.localdomain]/root(4): ps aux | grep lcd root 2368 0.0 0.6 3656 1356 ?? IN 1:15AM 0:00.05 /bin/sh /usr/local/etc/rc.d/lcdproc.sh start root 4742 0.0 6.9 36188 16956 ?? SN 1:15AM 0:00.46 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php [2.0.1-RELEASE][root@x-core.localdomain]/root(5): ps aux | grep LCD root 36882 0.0 0.5 3352 1148 ?? IN 1:15AM 0:00.01 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf nobody 37026 0.0 0.6 3368 1472 ?? SNs 1:15AM 0:00.17 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf
The interesting thing is that the first instance of LCDd is still running as root because it fails to start correctly. Probably because it is trying to start on port 13666 but there is already an instance of LCDd running on 13666 at that point.
The odd thing is that it is not killed by the startup script hence the kill-loop gets stuck and lcdproc.sh is still running.Steve
-
Hi Steve,
reading the documentation of LCDproc, the only thing that come to my mind is to insert some delays in the parallel port communication (http://lcdproc.sourceforge.net/docs/lcdproc-0-5-5-user.html#ppttrouble).
I think the sdeclcd driver do not accept this as parameter, the only way to do it is by code.Do you think you could add some "DELAYMULT" in the driver?
Thanks,
Michele -
@http://lcdproc.sourceforge.net/docs/lcdproc-0-5-5-user.html#ppttrouble:
Software Too Fast
If you have a super GHz computer it may happen that the signal timing generated by LCDd is too fast. Adjust DELAYMULT in the source file to a bigger value. Parallel port wirings usually don't permit to read back the busy flag of the controller chip, so timing must be adjust so that the controller never is busy.
I don't think this will help since the display runs perfectly once it's correctly started the server and client.
I tried removing the sync function for lcdproc_screens completely. I didn't help. It didn't reduce the number of LCDd restarts since it only restarts LCDd if it's already running and it isn't at that point.
More testing….
Steve
-
The interesting thing is that the first instance of LCDd is still running as root because it fails to start correctly. Probably because it is trying to start on port 13666 but there is already an instance of LCDd running on 13666 at that point.
The odd thing is that it is not killed by the startup script hence the kill-loop gets stuck and lcdproc.sh is still running.This looks strange… were you able to save the service options from the interface in order to make the script to recreate the start/stop script? I say this because lcdproc.sh should not be visible anymore...
Also, if you run manually the script "lcdproc.sh stop" does it work?
Which options of killing do work for you? (for example, kill -9)
Thanks,
Michele -
Once I have logged via ssh I can kill the extra LCDd process with any method. But is that because I am logged in as root?
I believe it is only still running because it is stuck in the kill loop. As soon as I have killed the process manually the rc script continues and creates another php client.
I've spent so much time thinking about this I ended up dreaming about it! ::)
Steve
-
Have you tried to sudo su the kill command? Is there such thing in FreeBSD 8.1?
-
Hi Steve,
I removed the "while cycle" in lcdproc.sh. Now the script should not loop at the startup. I checked both some rapid "service restarts" then a "reboot", at the end I only had one server and client running.Btw, I think this it just a workaround, what is not clear is why in your case more instances of the client and the server are run at the startup.
I didn't update the version of the package, in order to get the change you should remove then install the lcdproc-dev package.
Please let me know if this solve your problem!!
Thanks,
Michele -
I'll update and try that.
I tried removing the loop before and while it solved the stuck rc script I still ended up with two instances of LCDd, one running as root. :-\Steve
-
Hi Steve,
mmhhh… can you send me your config.xml file? (of course, hide the password, public ips, and so on)Ciao,
Michele -
Here's my config file, password redacted, it's test box so it doesn't have a public IP.
I don't see it in my logs any more, possibly because the logging level is now back at 3 or I was using the 'debug' version of LCDd, but previously there was a line at boot something like:LCDd: Could not open 13666, aborting
There is still a log line:
LCDd: Connect from host 127.0.0.1:58234 on socket 12
This implies that at some point there are two clients running.
Steve
-
I have replicated some of my previous testing for reference.
Editing lcdproc.inc so that the resulting lcdproc.sh is:#!/bin/sh # This file was automatically generated # by the pfSense service handler. rc_start() { ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs kill ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill /usr/bin/nice -20 /usr/local/sbin/LCDd -u nobody -c /usr/local/etc/LCDd.conf /usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php & } rc_stop() { ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs kill ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill } case $1 in start) rc_start ;; stop) rc_stop ;; restart) rc_stop rc_start ;; esac
Results in after boot:
[2.0.1-RELEASE][root@x-core.localdomain]/root(1): ps aux|grep lcd root 16096 3.0 6.9 36188 16980 ?? SN 1:41PM 0:00.27 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php root 16748 3.0 6.9 36188 16980 ?? SN 1:41PM 0:00.27 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php [2.0.1-RELEASE][root@x-core.localdomain]/root(2): ps aux | grep LCD
And in the system log:
Feb 23 13:41:31 LCDd: Critical error while initializing, abort. Feb 23 13:41:31 LCDd: sock_init: error creating socket - Address already in use Feb 23 13:41:31 LCDd: sock_create_inet_socket: cannot bind to port 13666 at address 127.0.0.1 - Address already in use
Which implies this wasn't happening before.
Steve
-
mmhhh… Steve, stupid question.
Are you sure that somewhere there is a script that runs the package at the startup, as a surplus of the times where you had to run LCDproc manually because it was not compatible with the sdelcd driver?
Did you start from scratch with this test box?
Thanks,
Michele