pfSense Support Subscription

Author Topic: [LCDProc] - Could not read config file  (Read 15216 times)

0 Members and 1 Guest are viewing this topic.

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #30 on: November 30, 2014, 07:09:31 pm »
Nice discovery. Leaves me puzzled as to why my install is working though. I don't remember them being symlinks. I'll check tomorrow. Maybe if you had copied the older version it would have also worked.  :-\

Steve

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #31 on: November 30, 2014, 09:11:02 pm »
Nice discovery. Leaves me puzzled as to why my install is working though. I don't remember them being symlinks. I'll check tomorrow. Maybe if you had copied the older version it would have also worked.  :-\

Steve

I think I tried that a couple of days ago when I was playing with permissions. I think I copied the lcdproc executables from the pbi dir to usr/local and it was a no go. At this point I believe it may be a problem with LCDd using libraries maybe incompatible with FreeBSD 10.
Maybe on your install you are using other plugins that have updated some of the common libraries and that's why lcdproc works for you.

Well isn't it time to upgrade lcdproc to the latest release anyway? How do we contact the lcdproc-dev maintainer? It should be a simple upgrade to do as the php code works untouched.

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #32 on: December 01, 2014, 03:46:51 am »
If this is just a matter of updating the lcdproc version then just try installing the original lcdproc package which is now at 0.5.7-1. Even if the sdeclcd driver isn't there (it might be since it's in lcdproc upstream now) you should still be able to set a driver and start LCDd. It should be able to open the conf file. However I'm back here at my test box this morning and I misremembered, I do have symlinks to the lcdproc binaries. All three point to /usr/pbi/lcdproc-i386/bin though. Don't know if that's relevant , probably not since the sbin directory is a symlink to bin.
Anyway I'm still at a loss to explain why my box is running it just fine.  :-\

Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: ./LCDd -h
LCDd - LCDproc Server Daemon, 0.5.6

Copyright (c) 1998-2012 Selene Scriven, William Ferrell, and misc. contributors.
This program is released under the terms of the GNU General Public License.

Usage: LCDd [<options>]
  where <options> are:
    -h                  Display this help screen
    -c <config>         Use a configuration file other than /usr/local/etc/LCDd.conf
    -d <driver>         Add a driver to use (overrides drivers in config file) [curses]
    -f                  Run in the foreground
    -a <addr>           Network (IP) address to bind to [127.0.0.1]
    -p <port>           Network port to listen for connections on [13666]
    -u <user>           User to run as [nobody]
    -w <waittime>       Time to pause at each screen (in seconds) [4]
    -s <bool>           If set, reporting will be done using syslog
    -r <level>          Report level [2]
    -i <bool>           Whether to rotate the server info screen
Critical error while processing settings, abort.
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: md5 LCDd
MD5 (LCDd) = 7417069cc4304f776d9c64e12c55ec97
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: md5 lcdproc
MD5 (lcdproc) = 7417069cc4304f776d9c64e12c55ec97

Are you running a clean install? Both my boxes are updates from 2.1.X.

Steve

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #33 on: December 01, 2014, 04:31:56 am »
Theory: LCDd cannot read the conf file because it is somehow locked by a previously run instance of LCDd. Your box is setup to run LCDd using the package rc script which is notoriously bad at starting cleanly. I am using Shellcmd scripts.
Try running with report level 5 (-r 5) at the CLI.

This doesn't explain why updating the binary solves the issue though.

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #34 on: December 01, 2014, 09:48:34 am »
OK the mystery gets thicker.....at least for me. somebody more knowledgeable may shed some light.

removed freebsd package, then removed pfsense lcdproc-dev. Clean slate now.

Installed pfsense lcdproc wich is 0.5.7_1, same version as freebsd pkg.

setup driver to curses, setup some screens ----> no go.

Start LCDd from console: /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf --> bombs saying cannot read config file.
Starting LCDd executable from pbi/..../bin  directory --> same result as above.

Install freebsd lcdproc pkg. symlinks on /usr/local/sbin and bin get overwritten by pkg executables.

Start  freebsd LCDd executable from  /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf --> All OK. reads config and just work.

Now are the 2 executables same?

MD5 (/usr/pbi/lcdproc-i386/bin/LCDd) = ebbd43300381f0291d6deddc9e4c97b9 (pfsense)
MD5 (/usr/local/sbin/LCDd) = 4061ed254181a5a518bcafcbc8695810 (freebsd)

No they are not. Now is it a library problem?

Overwrite /usr/local/sbin/LCDd (freebsd) with /usr/pbi/lcdproc.../bin/LCDd and keep everything else equal
Run LCDd from /usr/local/sbin/LCDd  --> complains it cannot find LCDd.pbiopt
copy LCDd.pbiopt from /usr/pbi/lcdproc.../bin to /usr/local/sbin
Try to run LCDd again --> original error that cannot read config file in /usr/local/etc/LCDd.conf

So we have come full circle.

My conclusions at this point (probably flawed by my lack of knowledge about the pbi package system)

Not a library problem, don't think LCDd uses any special library other than the different drivers

freebsd and pfsense LCDd same version but compiled with different compiler options or code to support pbi (probably same compiler options/code used on lcdproc-dev and this is why they are suffering from the same problem)

Now I dont know anything about PBI and I dont know the function of the pbiopt file. My has the following lines.

cat LCDd.pbiopt
PROGDIR: /usr/pbi/lcdproc-i386
TARGET: sbin/LCDd

It would seem something describing the location of the executable. in my PBI installation of lcdproc /usr/pbi/lcdproc.../sbin is a symbolic link to the bin directory.
I wonder if the pbi version of lcdproc uses the information from pbiopt and in some ways screws up the relative path to the config file even if it is specified by the c option.

Just speculations on my end at this point as I will have to read about building pbi packages and experiment. My understanding is that to build packages you need access to the super secret tool repository which I dont have. Otherwise I would take a stab at playing with the package to make it work.

Back to the freebsd package for now







Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #35 on: December 01, 2014, 09:59:08 am »
Still cant understand why Stephen install works. Mine did not work after an upgrade from 2.1.5 and did not work after a fresh install of the Nov30 2gb nanobsd version. Maybe there is an issue with pbi permissions that in some way are different between my install and Stephen

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #36 on: December 01, 2014, 10:44:10 am »
Yes, odd. One thing that might be a factor is that uninstalling and then reinstalling a package does not remove the package config scetion from the config file. The fact that I had this installed and running in 2.1.5 before ungrading to 2.2 seems significant.
Looking back at my MD5 sums above for the 0.5.6 pbi binaries I thought I made some error because the files LCDd and lcdproc are the same file! Also lcdexec is the same file.  :o Also they are only 9k which seems way too small. My own tiny program is bigger than that.
I don't understand the pbi package system either.

Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: md5 LCDd
MD5 (LCDd) = 7417069cc4304f776d9c64e12c55ec97
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: md5 lcdproc
MD5 (lcdproc) = 7417069cc4304f776d9c64e12c55ec97
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/bin: md5 lcdexec
MD5 (lcdexec) = 7417069cc4304f776d9c64e12c55ec97

When it can't read the file did you try starting it at report level 5?

Steve
« Last Edit: December 01, 2014, 10:53:28 am by stephenw10 »

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #37 on: December 01, 2014, 10:52:32 am »
Stephen on my first attempt I also upgraded from 2.1.5 where lcdproc was working just fine and did not work. I then did a fresh install and did not work either. I think the data in config.xml is used to write the real LCDd.conf file in /usr/etc. What is interesting is that leaving everything in the configs equal except for using the freebsd LCDd executable makes it work. This is why I think the problem is with the executable and may have to do with some built in security on the pbi version that get bypassed by the freebsd LCDd. Again I dont know much about building pbi's so just speculation.

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #38 on: December 01, 2014, 11:06:33 am »
Ah, so those files are not actually the executables. The real files are:
Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/local/bin: md5 lcdproc
MD5 (lcdproc) = 2ec55b6ee3598d850bde73aa40d65bc4
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/local/bin: md5 lcdexec
MD5 (lcdexec) = 2b7e6ad087f87b86fb44b5fb69731b82
[2.2-BETA][root@pfSense.localdomain]/usr/pbi/lcdproc-i386/local/sbin: md5 LCDd
MD5 (LCDd) = cf735ce4045190e52f00a2755e80b6cf

Try moving those. And try a high reporting level if it still fails.

Steve

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #39 on: December 01, 2014, 11:18:36 am »
Tried to move those and gives the same error. Interesting it seems just LCDd to be problematic. lcdproc and lcdexec seem to do fine unchanged.

Now wrestling with another issue. I cant upgrade to a new snapshot. The beauty of running betas... Fun though!

Offline chpalmer

  • Hero Member
  • *****
  • Posts: 1758
  • Karma: +93/-3
    • View Profile
    • Home of Cablenut
Re: [LCDProc] - Could not read config file
« Reply #40 on: December 01, 2014, 12:12:37 pm »

The LCD package is also working on my 2.2 testbox (XTM 5 Series) after following your guide Steve.

Im running on a 4G CF and cannot remember if I ever had 2.1.x on it but don't believe I did. I don't mind yanking the card and starting over if needed.


P.S. statements made by me are not necessarily condoned by the management of this fine organization.  http://badmodems.com

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #41 on: December 01, 2014, 02:23:00 pm »
even more interesting. 64 or 32 bits?

Offline chpalmer

  • Hero Member
  • *****
  • Posts: 1758
  • Karma: +93/-3
    • View Profile
    • Home of Cablenut
Re: [LCDProc] - Could not read config file
« Reply #42 on: December 01, 2014, 02:24:40 pm »

64bit
P.S. statements made by me are not necessarily condoned by the management of this fine organization.  http://badmodems.com

Offline stephenw10

  • Administrator
  • Hero Member
  • *****
  • Posts: 11912
  • Karma: +467/-15
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #43 on: December 02, 2014, 06:12:07 pm »
OK I'm back home after being away for a week and restricted to just one test box and forgot my USB/serial adapter.  ::)

So I've flashed a card with a clean Nano image in my X550e.
Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/root: uname -a
FreeBSD pfSense.localdomain 10.1-RELEASE FreeBSD 10.1-RELEASE #0 29f4af5(releng/10.1)-dirty: Tue Dec  2 00:20:42 CST 2014     root@pfsense-22-i386-builder:/usr/obj.i386/usr/pfSensesrc/src/sys/pfSense_wrap.10.i386  i386

After installing added WGXepc, because otherwise the fans drive me insane. Then enabled SSH, allowed unsigned packages, added an allow all rule on WAN, copied the LCDd.conf file attached above to /conf and added the shellcmd package.
Then I installed the lcdproc package and then uninstalled it because it doesn't include the SDECLCD driver.
Then I installed the lcdproc-dev package.
It started no problems, it behaves exactly as I would expect.

Without specifying a conf file:
Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/root: LCDd -r 5
LCDd version 0.5.6 starting
Built on Apr 22 2014, protocol version 0.3, API version 0.5
Using Configuration File: /usr/local/etc/LCDd.conf
Could not read config file: /usr/local/etc/LCDd.conf
Set report level to 5, output to stderr
Critical error while processing settings, abort.

Specifying a conf file:
Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/root: LCDd -c /conf/LCDd.conf -r 5

Gives logs:
Code: [Select]
[2.2-BETA][root@pfSense.localdomain]/root: clog /var/log/system.log | grep LCDd
Dec  2 23:47:34 pfSense LCDd: LCDd version 0.5.6 starting
Dec  2 23:47:34 pfSense LCDd: Using Configuration File: /conf/LCDd.conf
Dec  2 23:47:34 pfSense LCDd: Listening for queries on 127.0.0.1:13666

I didn't setup anything using the lcdproc gui pages

I am at a loss to explain why it won't run for you.  :-\

Do you have anything in /usr/local/etc/rc.d? If you enable lcdproc via the gui you get an lcdproc rc file there, perhaps that is being called? Hard to see why though.

Steve

« Last Edit: December 02, 2014, 06:19:36 pm by stephenw10 »

Offline jjstecchino

  • Full Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: [LCDProc] - Could not read config file
« Reply #44 on: December 03, 2014, 05:06:43 pm »
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?