Koozali.org: home of the SME Server

Use of uninitialized value in string eq

Offline dilligaf

  • *
  • 266
  • +0/-0
    • http://www.willcraft.com
Use of uninitialized value in string eq
« on: March 27, 2009, 08:47:14 PM »
I am seeing this in message log.
I looked at the templates it mentions, but have no idea how to determine what is wrong.
Any assistance greatly appreciated

WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers: Use of uninitialized value in string eq at /etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers line 9.

Mar 27 13:32:32 aplus-webserver e-smith[11293]: WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers: Use of uninitialized value in string eq at /etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers line 9.

Mar 27 13:32:32 aplus-webserver e-smith[11293]: WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers: Use of uninitialized value in string eq at /etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers line 8.

Mar 27 13:32:32 aplus-webserver e-smith[11293]: WARNING: Template processing succeeded for //etc/dhcpd.conf: 3 fragments generated warnings

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Use of uninitialized value in string eq
« Reply #1 on: March 28, 2009, 08:05:46 AM »
I am seeing this in message log.
I looked at the templates it mentions, but have no idea how to determine what is wrong.
Any assistance greatly appreciated

You need to open each of the three files mentioned and look at the cited lines. My guess is that they refer to configuration database values that no longer exist.

Quote
/etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers line 9.
/etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers line 9.
/etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers line 8.

You can open the files one at a time in pico:

Code: [Select]
pico /etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers

If you don't understand the cited lines, then post them here to see what might be going on. Also post the output of 'db configuration show dhcpd'.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Use of uninitialized value in string eq
« Reply #2 on: March 28, 2009, 09:23:14 AM »
Pleas do not report problems like this in the forums, but open a bug for it. David please do not troubleshoot these issues here but refer OP to the bugtracker, TIA.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Use of uninitialized value in string eq
« Reply #3 on: March 28, 2009, 09:28:48 AM »
cactus: happy to do that if required, but because this is a custom template IMHO it belongs in the forum.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Use of uninitialized value in string eq
« Reply #4 on: March 28, 2009, 09:33:19 AM »
cactus: happy to do that if required, but because this is a custom template IMHO it belongs in the forum.
Oops... :-?

OP, please provide the code snippets here to see where things go wrong, since they are custom templates we need to see it's contents first before we can determine what might be the issue.
« Last Edit: March 28, 2009, 09:36:04 AM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: Use of uninitialized value in string eq
« Reply #5 on: March 28, 2009, 09:34:09 AM »
No worries :cool:

Offline dilligaf

  • *
  • 266
  • +0/-0
    • http://www.willcraft.com
Re: Use of uninitialized value in string eq
« Reply #6 on: March 28, 2009, 05:43:17 PM »
You need to open each of the three files mentioned and look at the cited lines. My guess is that they refer to configuration database values that no longer exist.

You can open the files one at a time in pico:

Code: [Select]
pico /etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers

If you don't understand the cited lines, then post them here to see what might be going on. Also post the output of 'db configuration show dhcpd'.

[root@aplus-webserver root]# /sbin/e-smith/db configuration show dhcpd
dhcpd=service
    end=192.168.0.250
    start=192.168.0.101
    status=disabled
[root@aplus-webserver root]#

pico /etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers

{
    local %conf;
    $conf{'dhcpd'} = $dhcpd;

    local $dhcpdnscustom = db_get_prop(\%conf, 'dhcpd', 'dnscustom');
    local $dhcpdns1server   = db_get_prop(\%conf, 'dhcpd', 'dns1server');
    local $dhcpdns2server   = db_get_prop(\%conf, 'dhcpd', 'dns2server');

        if ($dhcpdnscustom eq 'enabled')
        {
            if ($dhcpdns2server eq "" )
            {
            $OUT .= "        option domain-name-servers $dhcpdns1server;";
            }
            else
            {
            $OUT .= "    option domain-name-servers $dhcpdns1server, $dhcpdns2server;";
            }
        }
        else
        {
        $OUT .= "    option domain-name-servers        $LocalIP;";
        }
}


pico /etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers
{

    local %conf;
    $conf{'dhcpd'} = $dhcpd;

    local $dhcpwinscustom = db_get_prop(\%conf, 'dhcpd', 'winscustom');
    local $dhcpwinsserver   = db_get_prop(\%conf, 'dhcpd', 'winsserver');

        if ($dhcpwinscustom eq 'enabled')
        {
        $OUT .= "    option netbios-name-servers $dhcpwinsserver;";
        }
        else
        {
                return "" unless $DHCP_WINSServer;
        return "    option netbios-name-servers $DHCP_WINSServer;";
        }
}

 pico /etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers
{
    local %conf;
    $conf{'dhcpd'} = $dhcpd;

    local $dhcpgatewaycustom = db_get_prop(\%conf, 'dhcpd', 'gatewaycustom');
    local $dhcpgateway   = db_get_prop(\%conf, 'dhcpd', 'gateway');

        if ($dhcpgatewaycustom eq 'enabled')
        {
                $OUT .= "    option routers $dhcpgateway;";
        }
        else
        {
        my $router = (defined $SystemMode && $SystemMode =~ /servergateway/)
                ? $LocalIP :
            defined $GatewayIP ? $GatewayIP : undef;

        $OUT = "";
        if ($router)
        {
                $OUT .= "    option routers $router;";
        }
        }
}

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Use of uninitialized value in string eq
« Reply #7 on: March 28, 2009, 06:16:41 PM »
The errors are caused by statements in the following lines for the following files:

/etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers
Code: [Select]
local $dhcpdnscustom = db_get_prop(\%conf, 'dhcpd', 'dnscustom');
/etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers
Code: [Select]
local $dhcpwinscustom = db_get_prop(\%conf, 'dhcpd', 'winscustom');
/etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers
Code: [Select]
local $dhcpgatewaycustom = db_get_prop(\%conf, 'dhcpd', 'gatewaycustom');
It means that the scripts are not setting a value to the variable because no value is set using the configuration database and therefore no value is returned, the variable stays uninitialized and hence the error you are receiving:

Use of uninitialized value in string eq at ...

Here is a little information from a quick Google search: http://coding.derkeiler.com/Archive/Perl/perl.beginners/2004-07/0345.html

[root@aplus-webserver root]# /sbin/e-smith/db configuration show dhcpd
dhcpd=service
    end=192.168.0.250
    start=192.168.0.101
    status=disabled
[root@aplus-webserver root]#

If you do not supply those values you used to have set through the dhcpd configuration setting, you have to set them agian, or properly initialise your variables by creating them first or allow a empty value to be set if nothing is returned from the database.

If you do not need those settings anymore there is no need for these template fragments and I suggest you remove them. What did you sue them for in the past?

On top of that you are using a ancient version of SME Server, shouldn't you consider upgradeing to a more recent version because of security updates, bug fixes and other improvements?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline dilligaf

  • *
  • 266
  • +0/-0
    • http://www.willcraft.com
Re: Use of uninitialized value in string eq
« Reply #8 on: March 28, 2009, 06:26:57 PM »
The errors are caused by statements in the following lines for the following files:

/etc/e-smith/templates-custom//etc/dhcpd.conf/25DomainNameServers
Code: [Select]
local $dhcpdnscustom = db_get_prop(\%conf, 'dhcpd', 'dnscustom');
/etc/e-smith/templates-custom//etc/dhcpd.conf/25NetbiosNameServers
Code: [Select]
local $dhcpwinscustom = db_get_prop(\%conf, 'dhcpd', 'winscustom');
/etc/e-smith/templates-custom//etc/dhcpd.conf/25Routers
Code: [Select]
local $dhcpgatewaycustom = db_get_prop(\%conf, 'dhcpd', 'gatewaycustom');
It means that the scripts are not setting a value to the variable because no value is set using the configuration database and therefore no value is returned, the variable stays uninitialized and hence the error you are receiving:

Use of uninitialized value in string eq at ...

Here is a little information from a quick Google search: http://coding.derkeiler.com/Archive/Perl/perl.beginners/2004-07/0345.html

If you do not supply those values you used to have set through the dhcpd configuration setting, you have to set them agian, or properly initialise your variables by creating them first or allow a empty value to be set if nothing is returned from the database.

If you do not need those settings anymore there is no need for these template fragments and I suggest you remove them. What did you sue them for in the past?

On top of that you are using a ancient version of SME Server, shouldn't you consider upgradeing to a more recent version because of security updates, bug fixes and other improvements?

Thank you,
Yes I am aware of the version etc.
we are trying to get all deployed servers updated.
Some are easy, others owners etc get in the way.
Thanks again,
Dan
I was just on that server again, under configuration, there is a DHCP manager hat looks like it sets those values.
(although dhcp is not on, on the server)
« Last Edit: March 28, 2009, 06:42:28 PM by dilligaf »