#2705 Use of uninitialized value $ENV{"XCATROOT"}

2.7.1
closed
General (881)
5
2012-10-22
2012-03-19
No

xCAT 2.7 20120316 build on AIX.

When boot up SN , we get some error message from console.

Use of uninitialized value $ENV{"XCATROOT"} in concatenation (.) or string at /opt/xcat/sbin/xcatd line 14.

Here is the whole message.

AIX Version 7
Copyright IBM Corporation, 1982, 2011.
Console login: 0513-059 The conserver Subsystem has been started. Subsystem PID is 12255358.
[Mon Mar 19 01:46:18 2012] conserver (12255358): conserver.com version 8.1.16
[Mon Mar 19 01:46:18 2012] conserver (12255358): started as root' byroot'
/usr/sbin/named: continuing without SRC support
restartxcatd invoked by root.

Use of uninitialized value $ENV{"XCATROOT"} in concatenation (.) or string at /opt/xcat/sbin/xcatd line 14.
0513-059 The xcatd Subsystem has been started. Subsystem PID is 11534462.
0513-029 The conserver Subsystem is already active.
Multiple instances are not supported.
0513-059 The named Subsystem has been started. Subsystem PID is 10223708.
0513-044 The nfsd Subsystem was requested to stop.
0513-059 The nfsd Subsystem has been started. Subsystem PID is 11993200.
xCATd: service starting
xCAT: Allowing tabdump site for root from loopback

Discussion

  • Lissa Valletta

    Lissa Valletta - 2012-03-19

    Should we just not change the code in xcatd the following:

    BEGIN
    {
    $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
    # Required when using DB2 as the xCAT database:
    $ENV{'DB2INSTANCE'} = 'xcatdb';
    $ENV{'EXTSHM'} = 'ON';

    if (defined $ENV{ENABLE_TRACE_CODE}) {
      use lib "$ENV{'XCATROOT'}/lib/perl";    <--   change to   use lib "$::XCATROOT/lib/perl";
      use lib "/opt/xcat/lib/perl";          <-- remove this
      use xCAT::Enabletrace qw(loadtrace filter);
      loadtrace();
    }
    

    }

     
  • Lissa Valletta

    Lissa Valletta - 2012-03-19

    Formatting did not work too well, new code to replace the other,

    if (defined $ENV{ENABLE_TRACE_CODE}) {
    use lib "$::XCATROOT/lib/perl";
    use xCAT::Enabletrace qw(loadtrace filter);
    loadtrace();
    }

     
  • XiaoPeng Wang

    XiaoPeng Wang - 2012-03-21

    The root cause was that environment vars XCATROOT could not be load in the init (it read the /etc/inittab) to start the xcatd. init uses the /etc/environment to load the environment vars.
    So the change is to add the XCATROOT into both /etc/profile and /etc/environment

    revision 11927
    revision 11928

     
  • XiaoPeng Wang

    XiaoPeng Wang - 2012-10-22
    • status: pending --> closed