diff --git a/perl-xCAT-2.0/xCAT/Client.pm b/perl-xCAT-2.0/xCAT/Client.pm index 08684638e..62c72c64e 100644 --- a/perl-xCAT-2.0/xCAT/Client.pm +++ b/perl-xCAT-2.0/xCAT/Client.pm @@ -4,13 +4,6 @@ package xCAT::Client; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; - require lib; - lib->import("$::XCATROOT/lib/perl"); - if ($ENV{XCATBYPASS}) { - require xCAT::NodeRange; - require xCAT::Utils; - require xCAT::Table; - } } my $inet6support; @@ -89,6 +82,7 @@ sub submit_request { # without going through the socket connection to the xcatd daemon if ($ENV{XCATBYPASS}) { # Load plugins from either specified or default dir + require xCAT::Table; my %cmd_handlers; my @plugins_dirs = split('\:',$ENV{XCATBYPASS}); if (-d $plugins_dirs[0]) { @@ -212,7 +206,15 @@ sub plugin_command { my $sock = shift; my $callback = shift; my %handler_hash; + + # We require these only in bypass mode to reduce start up time for the normal case + #use lib "$::XCATROOT/lib/perl"; #use xCAT::NodeRange; + require lib; + lib->import("$::XCATROOT/lib/perl"); + require xCAT::NodeRange; + require xCAT::Table; + $Main::resps={}; my @nodes; if ($req->{node}) { diff --git a/xCAT-client-2.0/bin/xdsh b/xCAT-client-2.0/bin/xdsh index 5fbe4cd7a..487f52bb0 100644 --- a/xCAT-client-2.0/bin/xdsh +++ b/xCAT-client-2.0/bin/xdsh @@ -1,4 +1,5 @@ -#!/usr/bin/env perl +#!/usr/bin/perl +# !/usr/bin/env perl # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { @@ -10,7 +11,7 @@ use File::Basename; use Getopt::Long; require xCAT::MsgUtils; require xCAT::DSHCLI; -#require xCAT::Client; # delay the require of this until we know if -K was specified, because of XCATBYPASS mode +require xCAT::Client; my $bname = basename($0); #----------------------------------------------------------------------------- @@ -119,7 +120,6 @@ if (!($::CONTEXT_SET)) } } -require xCAT::Client; xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE; diff --git a/xCAT-client-2.0/share/doc/xCAT2.0RR.odt b/xCAT-client-2.0/share/doc/xCAT2.0RR.odt index dcfe549bc..1d42457b7 100644 Binary files a/xCAT-client-2.0/share/doc/xCAT2.0RR.odt and b/xCAT-client-2.0/share/doc/xCAT2.0RR.odt differ