[LCDProc] - Could not read config file



  • Hold on…. here you are doing something different I have to try.
    You are copying a LCDd.conf into /conf and staring LCDd pointing to that config. I have not tried that.
    From What I have seen, the lcdproc pfsense package saves and updates the LCDd.conf file in /usr/local/etc/LCDd.conf. If I recall correctlyit  launches LCDd with /usr/bin/nice 20 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf.

    Why did you save a config in /conf?



  • Interesting… if I copy the same LCDd.conf from /usr/local/etc to /conf and I run -c  from there it works but if I launch with -c to /usr/local/etc/LCDd.conf it doesnt!


  • Netgate Administrator

    @jjstecchino:

    Why did you save a config in /conf?

    Because when using the sdeclcd driver it's almost impossible to get the package to start reliably. Something in it can't cope with the multiple package restarts at boot and you usually end up with just LCDd running and no client but I've also seen two LCDds or just the client.  ::) I spent a fair few hours trying various modifications to the start script but in the end gave up. Even when it would start with the correct number of clients and servers it would crash after a day of so the next time the packages were restarted. I start the server and client using shellcmd entries and it works perfectly. Putting the conf file in /conf  means it survives a firmware update.

    This is interesting. I suggest it's looking in the wrong place. Maybe there isn't a full path being used somewhere. Does it give you anything more useful with '-r 5'?

    Steve

    Edit: You can read about the many things we tried starting from about here.



  • So Stephen what is your suggested configuration? copy LCDd.con to /conf and what else?
    What do you start in shellcmd other than LCDd?
    Any other configuration files to place in /conf?

    On a different note, the only thing that do not survive an upgrade are the msk and sk modules for the nic led, any suggestion on making them persistent after an upgrade? I guess I can place a cp command in shellcmd and perform an additional reboot after an upgrade but it is not very elegant.

    Also since you are the firebox guru, I wanted to mention a possible new problem with freebsd 10 and the mask nic. I used one of the msk nic on both of my firebox as a sync interface for carp. On 2.1 I had to add hw.msk.msi_disable=1 on loader.con.local and everything was good. On fobs 10 with or without mis disable both boxes would hang. nothing in the logs or no kernel errors. As I switched the sync interface to one of the sk nic I had no crashes anymore. I did that because I had the sense that crashes would happen when larger data chunks were getting transferred (i.e. dhcp or dans syncs)


  • Netgate Administrator

    Basically it's this:
    http://forum.pfsense.org/index.php/topic,7920.msg344513.html#msg344513
    You can see in the screenshot in that post what other stuff I have running.

    The modified kernel modules do not survive a firmware update for good reason. If the base FreeBSD version is changed then loading bad kernel modules could potentially render the box unable to boot. I usually store a copy of the modules in /conf so I can easily copy them back. Not having them load is largely aesthetic anyway. Also running lcdproc like I do requires a second reboot anyway because the package reinstalls at the first boot but after the shellcmd scripts are run so never starts on the first boot. Not great but, again, much better then having it crash out every few days or having to completely manually install it each time.  ;)
    I guess it would be relatively easy to put in a shellcmd that is something like; if /boot/modules/sk and msk don't exist then copy from /conf and reboot. The risk at a kernel update is low, it would probably just fail to load the modules, but is there. Let us know if you create such a command.

    Interesting about the msk lockups. Was that running the modified msk module? The previous issues that caused them to become unresponsive always triggered 'watchdog timeout' errors in the system logs. If you have nothing it's going to be hard to track down. They worked fine in the same config under 2.1.5? You could try booting in verbose mode, keeping the serial console open (or recording it's output) and forcing the issue.  :-
    There are a whole lot of changes in msk between 8.3rel and 10.1rel. Some in Rx checksum off load. You could try disabling any hardware offloading that is set.
    You could try one box using sk and the other using msk to try to determine which half of the carp pair is causing the problem. Not sure what that might tell us though.

    Steve



  • Thank you for pointing me to the lcdproc post.

    Regarding the msk kernel module I had the problem with the unmodified and modified one.
    This is the extent of my test as now.

    Tried with both boxes with sync interface on msk3, wan on sk0, and an on sk1. This was my working setup on 2.1.5. Can ping boxes back and forth without errors or freezes.

    I was reconfiguring my boxes from scratch, both on 2.2. Did basic setup on both, then started carp and update nat rules, dhcp static leases and dns forwarder, host overrides on one box and having them synced on the other.
    With every update the boxes kept on crashing. this had me puzzled. Then I started getting XMLRPC can't connect… error on the notification area on the master. XMLRPC was working previously with items synced to the second box. rebooted everything and retried. Could not get rid of the XMLRPC can't connect... error, checked firewall rules, ability to ping etc. and everything appeared fine as noting was changed from previously working setup. So I pulled the cf and reimaged them and restarted from scratch. same deal happened. XMLRPC worked for a little bit, then crashes and finally XMLRPC can't connect error. I went through this iteration a few times. The confusing element could be that I was also trying to work on LCDd and setting the nic led drivers. I went through this process at least once with the original nic drivers and at least a couple of times with the modified nic led drivers. at least once without the msk.msi disabled and all other time with the disable line in loader.config.local. Interesting both boxes would crash almost simultaneously. Hard crash, nothing working until reboot, webgui freezed, serial console freezed, ssh freezed.

    The last time I tried with the master sync interface on sk3. got similar problem but only the backup firebox would crash. I started again getting XMLRPC can't connect errors and thats when the backup boxes was crashed.
    I then moved sync on sk3 on the second box and since then no more crashes, no XMLRPC can't connect errors and I was able to complete my reconfig on both boxes.

    Now they are both running 2.2, carp and XMLRPC is perfectly functional, LCDd is working on both with the freebsd package overwriting the lcdproc-dev symbolic links with its executables, modified nic led drivers on both boxes. your fan and green led program on. Uptime is 36h without errors or crashes.

    My conclusion is msk driver on freebsd 10 is even more screwed up then it was in 8.3 but I may be wrong. Fortunately sk seems to be in good working order. I initially used msk3 because it was convenient for me to use the last nic port on the box for sync.

    I'll be glad to do some tests on msk but I don't know what tunable I need to modify. I guess I can run an iperf between the 2 boxes generating a lot of traffic and see if it crashes or not.

    It would be great to be able to use the lcdproc package straight so I don't have to download pkg, and lcdproc with every upgrade. I am going to try your solution with shellcmd that is definitely less aggravating then mine. It is puzzling that LCDd from pfsense can read a config file from /conf but not from /usr/local/etc. I wonder why it is doing it?

    How do I get my hands on the lcdproc-dev source? I would like to try to update lcdproc to 0.5.7 and go through the LCDd source to try to understand. Do I need any special tools to compile? Can I just setup a freebsd 10 on vmware and compile to recreate the package? I think I remember reading you need some tools from a restricted repository but I am not sure.


  • Netgate Administrator

    @jjstecchino:

    It is puzzling that LCDd from pfsense can read a config file from /conf but not from /usr/local/etc. I wonder why it is doing it?

    Indeed it is. I suspect it's something to do with the PBI system that I don't understand. The location /usr/local/etc seems to be significant in that it's written to by the pbi system. When you call LCDd at /usr/local/sbin it sees a symlink to /usr/pbi/lcdproc-i386/bin….. but the file there is just a place holder of some sort linked to the real file location in /usr/pbi/lcdproc-i386/local/sbin. I'm clearly guessing here but I suspect the various file linking may have the executable looking for the conf file in /usr/pbi/lcdproc-i386/local/etc. Or something like that.  ;) It would be easy to do with a bad path. It doesn't seem to distinguish between a bad conf file and no conf file at all. Though I've not tried a deliberately bad file.

    @jjstecchino:

    How do I get my hands on the lcdproc-dev source? I would like to try to update lcdproc to 0.5.7 and go through the LCDd source to try to understand. Do I need any special tools to compile? Can I just setup a freebsd 10 on vmware and compile to recreate the package? I think I remember reading you need some tools from a restricted repository but I am not sure.

    The pfSense packages repo is not restricted it's on the pfSense github:
    https://github.com/pfsense/pfsense-packages

    It's a long time since I tried to build a package (and failed!), before the pfsense-tools repo restriction came into being and before the switch to pbis. I'm not sure if you need the tools repo or not. Probably not to just generate a package but maybe to get it submitted upstream where all binaries are built by the pfSense build system. You could just message mdima and ask about updating it. Is there some specific reason to update to 0.5.7? 0.5.6 is most recent stable release.

    Steve


  • Netgate Administrator

    Yep, that is the issue. If you put the conf file in:

    /usr/pbi/lcdproc-amd64/local/etc
    

    (or i386 deppending on your architechture) LCDd runs no problem.

    Steve



  • @stephenw10:

    Yep, that is the issue. If you put the conf file in:

    /usr/pbi/lcdproc-amd64/local/etc
    

    (or i386 deppending on your architechture) LCDd runs no problem.

    Steve

    Interesting. so even if LCDd fails saying it cannot read config from /usr/local/etc/LCDd.conf it is actually looking for it in the pbi path. Also if you specify with -c /usr/local/etc/LCDd.conf, it clearly disregards that manual override. I tried that many times. In that case does it still looks into the pbi path? probably if you specify with -c anything but the default path (/usr/local…) it respects that overrides otherwise it substitutes the obi path.

    Good info. How do we use it to our advantage for a seamless install of lcdproc persistent across snapshots upgrades? pfsense lcdproc package writes the config to /usr/local/etc/LCDd.conf, so the php code that does that, would need to be changed on the package in the repository with the path pointing to the pbi, or LCDd modified to respect the override with -c. Pending that your solution with shellcmd is probably the cleanest one but it requires an additional reboot. What is the exact function of LCDd.pbiopt? are there parameters that could be placed there to point to the correct path?
    If we get lcdproc-dev to work as it did in 2.15, do you think it will still suffer from lcdproc crashes as before?
    By the way with shellcmd as you suggested my lcd server hasn't crashed once yet.

    As far as 0.5.6 vs 0.5.7, no specific reasons other than lcdproc (non dev) is on that version.


  • Netgate Administrator

    I would suggest it's a bug in the pbi, some path is incorrectly specified. So either we can go away learn about PBIs, find the bug and submit a patch or find someone who already knows and ask them nicely.  ;)

    Rebooting the box is the easiest way to get the lcd functioning after an update but you can also just run the commands manually. I found it easier to read having the client and server as two separate commands but they could be strung together. What would be nice would be a button on the Shellcmd screen to run the command now.

    I think the lcdproc-dev package will still crash. It may start better, I've not tried it. It would be better to merge the dev back into the original at this point. No point maintaining two packages. Since the dev package was forked an update in php meant that php processes had a limited run time. There is a workaround for that but I don't think it went into the package. In 2.2 php has changed quite a bit so I don't know if that still holds.

    Steve



  • Hello Steve a quick question for you as I guess you may have encountered this before.
    I setup lcdproc-dev as we previously discussed with the config file in /conf and LCDd+lcdproc stared in shellcmd. The lcdproc service is disabled in the gui and the com port is set to none as you described in your post.
    At startup pfsense still try to load LCDd so it get loaded twice, messing up the start up process. It hangs as lcdproc gets run.
    when I pgrep for LCDd and lcdproc I see 2 instances of LCDd (2 pids)and none for lcdproc (I do this while the startup proces is hung but fortunatelly sshd has started already) When I kill the first instance of LCDd the second instance get killed as well. if I pgrep for lcdproc now I see one pid for it which was not present while the 2 LCDd were running. As I kill the lcdproc pid the startup scripts continues until it displays the menu and the beeps on the serial console.
    Now if I restart LCDd and lcdproc from the command line using the /conf path the lcd works ok with all the screens I setup previously.

    It looks like pfsense despite having the lcdproc service disabled still runs LCDd and then I end up with 2 instances of it.
    I found a lcdproc.sh in /usr/local/etc/rc.d but removing that still does not prevent the double LCDd. Is there another place where LCDd could be started? I looked in the obvious places like  /etc/rc but unless I missed I did not see anything useful there. Any suggestions?

    Thanks


  • Netgate Administrator

    Hmm. I found that in 2.2 the start up file in usr/local/etc/rc.d was not removed even when the webgui was configured to remove it. I had to remove it manually. That worked for me.
    Another option that works is to uninstall lcdproc-dev, reinstall it and then don't ever enable it or set the driver. The Shellcmd lines will still run and start it using the lcdd.conf in /conf.

    Steve



  • I helped improve this package with my limited skills and time back in 2.1 but now in 2.2 it will only work somewhat if I do those commands you did to get it working.  Specify a config in the /conf folder that I moved not in the normal location.  Glad to see it  doing something but not 100% normal looking.

    I run a crystal fonts 735 display



  • @Steve and Topper, maybe we can put our heads together and fix this package



  • I am not that good at fixing it.. I need to relearn since I forgot a few things over the years
    I don't know the new php stuff they just changed to in new version .. never used before..


  • Netgate Administrator

    What did you update from/to? What method were you using to start lcdd?

    Steve



  • The lcdproc_client.php does not even start after the last three updates. It looks like the client is unable to connect, but this is bullshit because the other client /usr/pbi/lcdproc-i386/bin/lcdproc works like a treat.

    Hm, it looks like i also found a bug in the php file.  :)

    [2.2-RC][admin@pfsense.localdomain]/root: /usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
    
    Warning: fsockopen(): unable to connect to localhost:13666 (Operation timed out) in /usr/local/pkg/lcdproc_client.php on line 915
    
    Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in /usr/local/pkg/lcdproc_client.php on line 916
    

  • Netgate Administrator

    Using the lcdproc or lcdproc-dev package? What hardware?

    Steve



  • I use lcdproc-dev and my hardware is a Watchguard X1000. I found something strange in the file LCDd.conf, the path to the drivers seem to be wrong.

    LCDd.conf

    [server]
    DriverPath=/usr/local/lib/lcdproc/
    Driver=sdeclcd
    Bind=127.0.0.1
    Port=13666
    ReportLevel=3
    ReportToSyslog=yes
    User=nobody
    Foreground=no
    ServerScreen=no
    GoodBye="Thanks for using"
    GoodBye="    pfSense     "
    WaitTime=5
    PrevScreenKey=Down
    NextScreenKey=Up
    [menu]
    MenuKey=Left
    EnterKey=Right
    UpKey=Up
    DownKey=Down
    [sdeclcd]
    

    It seems to work after I changed the path to the following. I rebooted my firewall several times and no problem whatsoever with the lcdproc_client.php.

    DriverPath=/usr/pbi/lcdproc-i386/local/lib/lcdproc/
    

  • Netgate Administrator

    I'm using /usr/local/lib/lcdproc/ and it's working fine. I'm not using the php client though.
    The path to the driver cannot affect the client directly but it could stop the daemon running. Did you see the lcdproc server start?

    Steve



  • I have no drivers in this path, only in /usr/pbi/lcdproc-i386/local/lib/lcdproc/. The lcdproc started, I can see that in the LCD display and with the ps command.


  • Netgate Administrator

    I have no drivers there either. It shouldn't matter because the PBI system is supposed to take care of that. When you call the LCDd executable it is actually a link to file within the PBI subdirectories. From there the relative path results in the location you are entering.

    Was LCDd starting before you changed the driver path?

    Steve



  • My LCD started every time before i changed the path, except that the display showed zero screens (the LCD screen showed only LCDproc Server Cli: 0 Scr: 0).

    The only problem for now, if the service dies I cannot simply restart it to get the displays back. In the previous pfSense version, I just ran the following script to solve the problem. Now I only get the message unable to connect to localhost:13666.

    /usr/local/etc/rc.d/lcdproc.sh restart
    

  • Netgate Administrator

    Have you read the rest of this thread where I talked about having to use a different startup procedure? I suspect that if you're still using the package method you probably have two copies of LCDd running on different ports one of which isn't responding.

    Steve



  • Only one process when i ran this command.

    [2.2-RC][admin@pfsense.localdomain]/root: pgrep -anx LCDd
    70130
    

    Something changed in one of the latest updates, now I cannot restart the service like before. The only way to get the screens back is to reboot pfsense.

    [2.2-RC][admin@pfsense.localdomain]/root: /usr/local/etc/rc.d/lcdproc.sh restart
    [2.2-RC][admin@pfsense.localdomain]/root: 
    Warning: fsockopen(): unable to connect to localhost:13666 (Operation timed out) in /usr/local/pkg/lcdproc_client.php on line 915
    
    Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in /usr/local/pkg/lcdproc_client.php on line 916
    


  • I disabled the firewall with the following command, but it is not possible to connect to localhost.

    'pfctl -d
    

    Everything works as expected after that I changed the LCDd daemon to listen on the LAN IP address and the client to connect to the same address.

    Edit:

    I permanently fixed the problem by editing the following file.

    /usr/local/pkg/lcdproc.inc

    	define('LCDPROC_HOST','localhost');
    	define('LCDPROC_PORT','13666');
    

    My changes: See line 36

    	define('LCDPROC_HOST','127.0.0.1');
    	define('LCDPROC_PORT','13666');
    


  • I made those code changes in /usr/local/pkg/lcdproc.inc and changes in the LCDd.conf file.

    I am using LCDproc-dev

    DriverPath=/usr/pbi/lcdproc-amd64/local/lib/lcdproc

    This is where my drivers are in the 64 bit version.

    When I start the service I get
    Could not read config file: /usr/local/etc/LCDd.conf
    Critical error while processing settings, abort.

    but I have the file there. It has 644 permissions to the Proxy group

    I get nothing back when I run pgrep -anx LCDd

    I ran the service by
    /usr/local/etc/rc.d/lcdproc.sh restart

    and got
    Could not read config file: /usr/local/etc/LCDd.conf
    Critical error while processing settings, abort.

    Warning: fsockopen(): unable to connect to 127.0.0.1:13666 (Operation timed out) in /usr/local/pkg/lcdproc_client.php on line 915

    Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in /usr/local/pkg/lcdproc_client.php on line 916

    If someone gets me the fix code I will put it into the version and have it merged so it will be updated for everyone



  • @Topper727:

    When I start the service I get
    Could not read config file: /usr/local/etc/LCDd.conf

    For some reason the conf file must be located in the following path.

    32-bit

    /usr/pbi/lcdproc-i386/local/etc/
    

    64-bit

    /usr/pbi/lcdproc-amd64/local/etc
    

  • Netgate Administrator

    More accurately you can put the conf file anywhere but /usr/local/etc because if you do LCDd will look in the wrong place. This appears to be an issue with the pbi packaging.

    Steve



  • Has someone started to work on this or not.. I wish I had this working.. if working i might spend some effort to make some new features for it



  • BUMP


  • Netgate Administrator

    Not much motivation since it works fine if you don't use the php client and move the config file, which is how I'm running it.  ;)

    Since this appears to be a PBI problem do we have a link to some PBI docs? pfSense is moving away from PBIs in the future so it may be solved by that anyway.

    Steve



  • Made some changes to the LCDproc.inc file and it works now on 64 bit.

    https://github.com/topper727/pfsense-packages/commit/2cd89f970053f4bf0fa23d0b88f50e69ab68f410

    I hope someone can bump the version number as I not skilled at that yet

    I can even make changes in UI page and the screen will restart and show the things I that I changed like I want



  • @Topper727:

    Made some changes to the LCDproc.inc file and it works now on 64 bit.

    https://github.com/topper727/pfsense-packages/commit/2cd89f970053f4bf0fa23d0b88f50e69ab68f410

    I hope someone can bump the version number as I not skilled at that yet

    I expect you will need code to set LCDPROC_CONFIG differently depending on the pfSense version, so that the package will still also work on older pfSense versions.
    e.g. Bandwidthd does tests to "Check pfSense version" from line 31 of:
    https://github.com/pfsense/pfsense-packages/blob/master/config/bandwidthd/bandwidthd.inc

    Set a constant with define() and use it further down to substitute the path as needed.

    Also, why do you need to add the "address of" "&" in various function parameters?

    The version bump is just a matter of editing the files at:
    https://github.com/pfsense/pfsense-packages
    like:
    pkg_config.10.xml
    pkg_config.8.xml
    pkg_config.8.xml.amd64

    Search for lcdproc and see where the version is - increment the last number.



  • The & was in my config.. not sure if I did while back or was part of a update that I got.  Either way that worked.  But yes you have point since the package points to amd 64 locations that would cause issue with i386 and older versions as I think they have different file structure

    My skills are limited.. Hope someone will help with this.

    And my time is limited also..

    Found Jim-p did that & stuff to the file little while ago
    https://github.com/topper727/pfsense-packages/commit/a890380266da7f589b809701bd3d0e8ac715e82f


Log in to reply