version 1.70, 2006/02/07 05:08:27
|
version 1.72, 2006/02/07 22:30:31
|
Line 260 if (-e $pidfile) {
|
Line 260 if (-e $pidfile) {
|
# Read hosts file |
# Read hosts file |
# |
# |
my $thisserver; |
my $thisserver; |
|
my %hostname; |
my $PREFORK=4; # number of children to maintain, at least four spare |
my $PREFORK=4; # number of children to maintain, at least four spare |
open (CONFIG,"$perlvar{'lonTabDir'}/hosts.tab") || die "Can't read host file"; |
open (CONFIG,"$perlvar{'lonTabDir'}/hosts.tab") || die "Can't read host file"; |
while (my $configline=<CONFIG>) { |
while (my $configline=<CONFIG>) { |
my ($id,$domain,$role,$name)=split(/:/,$configline); |
my ($id,$domain,$role,$name)=split(/:/,$configline); |
$name=~s/\s//g; |
$name=~s/\s//g; |
$thisserver=$name if ($id eq $perlvar{'lonHostID'}); |
$thisserver=$name if ($id eq $perlvar{'lonHostID'}); |
|
$hostname{$id}=$name; |
#$PREFORK++; |
#$PREFORK++; |
} |
} |
close(CONFIG); |
close(CONFIG); |
Line 424 sub make_new_child {
|
Line 426 sub make_new_child {
|
} |
} |
# end of log query |
# end of log query |
} elsif (($query eq 'fetchenrollment') || |
} elsif (($query eq 'fetchenrollment') || |
($query eq 'institutionalphotos')) { |
($query eq 'institutionalphotos')) { |
# retrieve institutional class lists |
# retrieve institutional class lists |
my $dom = &unescape($arg1); |
my $dom = &unescape($arg1); |
my %affiliates = (); |
my %affiliates = (); |
Line 658 Returns: The results of the message or '
|
Line 660 Returns: The results of the message or '
|
######################################################## |
######################################################## |
sub subreply { |
sub subreply { |
my ($cmd,$server)=@_; |
my ($cmd,$server)=@_; |
my $peerfile="$perlvar{'lonSockDir'}/$server"; |
my $peerfile="$perlvar{'lonSockDir'}/".$hostname{$server}; |
my $sclient=IO::Socket::UNIX->new(Peer =>"$peerfile", |
my $sclient=IO::Socket::UNIX->new(Peer =>"$peerfile", |
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Timeout => 10) |
Timeout => 10) |
or return "con_lost"; |
or return "con_lost"; |
print $sclient "$cmd\n"; |
print $sclient "sethost:$server:$cmd\n"; |
my $answer=<$sclient>; |
my $answer=<$sclient>; |
chomp($answer); |
chomp($answer); |
$answer="con_lost" if (!$answer); |
$answer="con_lost" if (!$answer); |