Welcome, Guest. Please login or register.

Author Topic: inconsistence in nedi.conf search between CLI and Web-GUI  (Read 3260 times)

steffen1

  • Guest
inconsistence in nedi.conf search between CLI and Web-GUI
« on: August 14, 2009, 08:16:41 AM »
Hi,

Having nedi.conf at /usr/local/nedi located, your installation depends on a softlink:
/etc/nedi.conf -> /usr/local/nedi/nedi.conf

because:

html/inc/libmisc.php:

if (file_exists('/var/nedi/nedi.conf')) {
                $conf = file('/var/nedi/nedi.conf');
        }elseif (file_exists('/etc/nedi.conf')) {
                $conf = file('/etc/nedi.conf');
        }else{
                echo "Dude, where's nedi.conf?";
                die;
        }

inc/libmisc.pl:

my $nconf = "$main::p/nedi.conf";
if (-e "$nconf"){
                open  ("CONF", $nconf);
        }elsif (-e "/etc/nedi.conf"){
                open  ("CONF", "/etc/nedi.conf");
        }else{
                die "Dude, where's nedi.conf?\n";
        }

After cloning a Nedi mechine, the Softlink was lost and took some time to find out the cause why NeDi not work. >:(


Steffen

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2632
    • View Profile
    • NeDi
Re: inconsistence in nedi.conf search between CLI and Web-GUI
« Reply #1 on: August 16, 2009, 08:04:28 PM »
What do you suggest to improve? I use $main::p in perl for the path, but how do you teach php where everything is?
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

steffen1

  • Guest
Re: inconsistence in nedi.conf search between CLI and Web-GUI
« Reply #2 on: December 24, 2009, 11:34:13 AM »
I use this now for

html/inc/libmisc.php:

Code: [Select]
if (file_exists('/var/nedi/nedi.conf')) {
                $conf = file('/var/nedi/nedi.conf');
        }elseif (file_exists('/etc/nedi.conf')) {
                $conf = file('/etc/nedi.conf');
        }elseif (file_exists('../nedi.conf')) {
                $conf = file('../nedi.conf');
        }else{
                echo "Dude, where's nedi.conf?";
                die;
        }

It's working in a Multi-instance nedi installation to quickly compare version differences in our lab as well
with base path /usr/local and sub dirs:
nedi
nedi.v10
nedi.v10nm
nedi.v104
nedi.v104nm

For this alone  I was need a solution independend from this softlink.

Steffen

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2632
    • View Profile
    • NeDi
Re: inconsistence in nedi.conf search between CLI and Web-GUI
« Reply #3 on: December 24, 2009, 01:25:50 PM »
Ok, I'll add the relative path again...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo