version 1.479, 2011/08/02 03:11:35
|
version 1.480, 2011/08/05 04:35:45
|
Line 92 my %managers; # Ip -> manager names
|
Line 92 my %managers; # Ip -> manager names
|
|
|
my %perlvar; # Will have the apache conf defined perl vars. |
my %perlvar; # Will have the apache conf defined perl vars. |
|
|
|
my $dist; |
|
|
# |
# |
# The hash below is used for command dispatching, and is therefore keyed on the request keyword. |
# The hash below is used for command dispatching, and is therefore keyed on the request keyword. |
# Each element of the hash contains a reference to an array that contains: |
# Each element of the hash contains a reference to an array that contains: |
Line 1646 sub read_lonnet_global {
|
Line 1648 sub read_lonnet_global {
|
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my $requested = &Apache::lonnet::thaw_unescape($tail); |
my $requested = &Apache::lonnet::thaw_unescape($tail); |
my $result; |
my $result; |
|
my %packagevars = ( |
|
spareid => \%Apache::lonnet::spareid, |
|
perlvar => \%Apache::lonnet::perlvar, |
|
); |
|
my %limit_to = ( |
|
perlvar => { |
|
lonOtherAuthen => 1, |
|
lonBalancer => 1, |
|
lonVersion => 1, |
|
lonSysEMail => 1, |
|
lonHostID => 1, |
|
lonRole => 1, |
|
lonDefDomain => 1, |
|
lonLoadLim => 1, |
|
lonUserLoadLim => 1, |
|
} |
|
); |
if (ref($requested) eq 'HASH') { |
if (ref($requested) eq 'HASH') { |
foreach my $what (keys(%{$requested})) { |
foreach my $what (keys(%{$requested})) { |
my $type = $requested->{$what}; |
|
my $lonnetglobal = 'Apache::lonnet::'.$what; |
|
my $response; |
my $response; |
if ($type eq 'HASH') { |
my $items = {}; |
if (defined(%{$lonnetglobal})) { |
if (exists($packagevars{$what})) { |
my $hashref = \%{$lonnetglobal}; |
if (ref($limit_to{$what}) eq 'HASH') { |
$response = &Apache::lonnet::freeze_escape($hashref); |
foreach my $varname (keys(%{$packagevars{$what}})) { |
|
if ($limit_to{$what}{$varname}) { |
|
$items->{$varname} = $packagevars{$what}{$varname}; |
|
} |
|
} |
|
} else { |
|
$items = $packagevars{$what}; |
} |
} |
} else { |
if ($what eq 'perlvar') { |
if (defined(${$lonnetglobal})) { |
if (!exists($packagevars{$what}{'lonBalancer'})) { |
$response = &escape(${$lonnetglobal}); |
if ($dist =~ /^(centos|rhes|fedora|scientific)/) { |
|
my $othervarref=LONCAPA::Configuration::read_conf('httpd.conf'); |
|
if (ref($othervarref) eq 'HASH') { |
|
$items->{'lonBalancer'} = $othervarref->{'lonBalancer'}; |
|
} |
|
} |
|
} |
} |
} |
|
$response = &Apache::lonnet::freeze_escape($items); |
} |
} |
$result .= &escape($what).'='.$response.'&'; |
$result .= &escape($what).'='.$response.'&'; |
} |
} |
Line 6404 $SIG{USR2} = \&UpdateHosts;
|
Line 6434 $SIG{USR2} = \&UpdateHosts;
|
&Apache::lonnet::load_hosts_tab(); |
&Apache::lonnet::load_hosts_tab(); |
my %iphost = &Apache::lonnet::get_iphost(1); |
my %iphost = &Apache::lonnet::get_iphost(1); |
|
|
my $dist=`$perlvar{'lonDaemons'}/distprobe`; |
$dist=`$perlvar{'lonDaemons'}/distprobe`; |
|
|
my $arch = `uname -i`; |
my $arch = `uname -i`; |
chomp($arch); |
chomp($arch); |