version 1.21, 2002/12/09 18:54:40
|
version 1.25, 2003/05/08 22:16:23
|
Line 1
|
Line 1
|
<!-- updatequery.piml --> |
<!-- updatequery.piml --> |
<!-- Scott Harrison --> |
|
|
|
<!-- $Id$ --> |
<!-- $Id$ --> |
|
|
Line 52 sleep(3);
|
Line 51 sleep(3);
|
</perlscript> |
</perlscript> |
</file> |
</file> |
<file> |
<file> |
|
<target dist='default'>loncom/hosts.tab</target> |
|
<perlscript mode='fg'> |
|
unless (-l "<TARGET />") { |
|
print(<<END); |
|
|
|
=============================================================================== |
|
What hosts.tab would you like to have installed? |
|
(hosts.tab is a listing of all other internet machines |
|
that a server system considers to be valid server systems |
|
on the LON-CAPA network) |
|
|
|
1) PRODUCTION - you want to deliver courses today or sometime very soon |
|
on this machine |
|
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
|
not be connected to other LON-CAPA machines for now |
|
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
|
4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab) |
|
|
|
END |
|
# Option number 26 will install rawhide_hosts.tab, but |
|
# the typical user does not want to be part of an intensive |
|
# machine test cluster. |
|
|
|
# get input |
|
# if valid then process, otherwise loop |
|
$flag=0; |
|
while (!$flag) { |
|
print "ENTER 1, 2, 3, or 4:\n"; |
|
my $choice=<>; |
|
chomp($choice); |
|
if ($choice==1) { |
|
$lonCluster='production'; $flag=1; |
|
} |
|
elsif ($choice==2) { |
|
$lonCluster='standalone'; $flag=1; |
|
} |
|
elsif ($choice==3) { |
|
$lonCluster='development'; $flag=1; |
|
} |
|
elsif ($choice==4) { |
|
$lonCluster='existing'; $flag=1; |
|
if (-e '/home/httpd/lonTabs/hosts.tab') { |
|
`cp /home/httpd/lonTabs/hosts.tab ../existing_hosts.tab`; |
|
} |
|
else { |
|
print <<END; |
|
There is no existing /home/httpd/lonTabs/hosts.tab |
|
END |
|
die(''); |
|
} |
|
} |
|
elsif ($choice==26) { |
|
$lonCluster='rawhide'; $flag=1; |
|
} |
|
} |
|
} |
|
</perlscript> |
|
</file> |
|
<file> |
<target dist='default'>/home/httpd/lonTabs/hosts.tab</target> |
<target dist='default'>/home/httpd/lonTabs/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
$|=1; |
$|=1; |
Line 305 my %perlvar;
|
Line 363 my %perlvar;
|
unless ($perlvar{'lonLoadLim'} and $perlvar{'lonLoadLim'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonLoadLim'} and $perlvar{'lonLoadLim'}!~/\{\[\[\[\[/) { |
$perlvar{'lonLoadLim'}='2.00'; |
$perlvar{'lonLoadLim'}='2.00'; |
} |
} |
|
unless ($perlvar{'lonUserLoadLim'} and $perlvar{'lonUserLoadLim'}!~/\{\[\[\[\[/) { |
|
$perlvar{'lonUserLoadLim'}='0'; |
|
} |
unless ($perlvar{'lonExpire'} and $perlvar{'lonExpire'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonExpire'} and $perlvar{'lonExpire'}!~/\{\[\[\[\[/) { |
$perlvar{'lonExpire'}='86400'; |
$perlvar{'lonExpire'}='86400'; |
} |
} |
Line 351 my %perlvar;
|
Line 412 my %perlvar;
|
unless ($perlvar{'lonLoadLim'} and $perlvar{'lonLoadLim'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonLoadLim'} and $perlvar{'lonLoadLim'}!~/\{\[\[\[\[/) { |
$perlvar{'lonLoadLim'}='2.00'; |
$perlvar{'lonLoadLim'}='2.00'; |
} |
} |
|
unless ($perlvar{'lonUserLoadLim'} and $perlvar{'lonUserLoadLim'}!~/\{\[\[\[\[/) { |
|
$perlvar{'lonUserLoadLim'}='0'; |
|
} |
unless ($perlvar{'lonExpire'} and $perlvar{'lonExpire'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonExpire'} and $perlvar{'lonExpire'}!~/\{\[\[\[\[/) { |
$perlvar{'lonExpire'}='86400'; |
$perlvar{'lonExpire'}='86400'; |
} |
} |
Line 376 my %perlvarstatic;
|
Line 440 my %perlvarstatic;
|
} |
} |
close(CONFIG); |
close(CONFIG); |
} |
} |
|
if (!$domainDescription && $lonCluster ne 'existing') { |
|
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
|
while(<IN>) { |
|
if (/^$perlvar{'lonHostID'}\:/) { |
|
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
|
chomp($domainDescription); |
|
last; |
|
} |
|
} |
|
close(IN); |
|
} |
|
if (!$domainDescription) { |
|
open(IN,'</home/httpd/lonTabs/hosts.tab'); |
|
while(<IN>) { |
|
if (/^$perlvar{'lonHostID'}\:/) { |
|
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
|
chomp($domainDescription); |
|
last; |
|
} |
|
} |
|
close(IN); |
|
} |
|
|
# implement editing logic below, interactively |
# implement editing logic below, interactively |
# update loncapa.conf until 7 is entered |
# update loncapa.conf until 8 is entered |
|
|
$flag=0; |
$flag=0; |
|
|
Line 393 This is now the current configuration of
|
Line 480 This is now the current configuration of
|
5) Role: $perlvar{'lonRole'} |
5) Role: $perlvar{'lonRole'} |
6) Cache Expiration Time: $perlvar{'lonExpire'} |
6) Cache Expiration Time: $perlvar{'lonExpire'} |
7) Server Load: $perlvar{'lonLoadLim'} |
7) Server Load: $perlvar{'lonLoadLim'} |
8) Everything is correct up above |
8) User Load: $perlvar{'lonUserLoadLim'} |
|
9) Everything is correct up above |
END |
END |
my $hbug=-1; |
my $hbug=-1; |
my $dbug=-1; |
my $dbug=-1; |
Line 420 if ($dbug) {
|
Line 508 if ($dbug) {
|
} |
} |
|
|
print(<<END); |
print(<<END); |
ENTER A CHOICE OF 1-7 TO CHANGE, otherwise ENTER 8: |
ENTER A CHOICE OF 1-8 TO CHANGE, otherwise ENTER 9: |
END |
END |
my $choice=<>; |
my $choice=<>; |
chomp($choice); |
chomp($choice); |
Line 496 END
|
Line 584 END
|
$perlvar{'lonLoadLim'}=$choice2; |
$perlvar{'lonLoadLim'}=$choice2; |
} |
} |
elsif ($choice==8) { |
elsif ($choice==8) { |
|
print(<<END); |
|
8) User Load: $perlvar{'lonUserLoadLim'} |
|
Numer of users that can login before machine is 'overloaded' |
|
ENTER NEW VALUE (integer value, 0 means ther is no limit): |
|
END |
|
my $choice2=<>; |
|
chomp($choice2); |
|
$perlvar{'lonUserLoadLim'}=$choice2; |
|
} |
|
elsif ($choice==9) { |
$flag=1; |
$flag=1; |
} |
} |
else { |
else { |
Line 517 END
|
Line 615 END
|
<target dist='default'>loncom/hosts.tab</target> |
<target dist='default'>loncom/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
unless (-l "<TARGET />") { |
unless (-l "<TARGET />") { |
print(<<END); |
my $hostname=`hostname`;chomp($hostname); |
|
my $hostaddress=`hostname -i $hostname`;chomp($hostaddress); |
=============================================================================== |
$hostaddress=~s/\s//; |
What hosts.tab would you like to have installed? |
|
(hosts.tab is a listing of all other internet machines |
|
that a server system considers to be valid server systems |
|
on the LON-CAPA network) |
|
|
|
1) PRODUCTION - you want to deliver courses today or sometime very soon |
|
on this machine |
|
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
|
not be connected to other LON-CAPA machines for now |
|
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
|
4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab) |
|
|
|
END |
|
# Option number 26 will install rawhide_hosts.tab, but |
|
# the typical user does not want to be part of an intensive |
|
# machine test cluster. |
|
|
|
# get input |
|
# if valid then process, otherwise loop |
|
my $hostname=`hostname`;chomp($hostname); |
|
my $hostaddress=`hostname -i $hostname`;chomp($hostaddress); |
|
$hostaddress=~s/\s//; |
|
$flag=0; |
|
while (!$flag) { |
|
print "ENTER 1, 2, 3, or 4:\n"; |
|
my $choice=<>; |
|
chomp($choice); |
|
$line2insert=<<END; |
|
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription |
|
END |
|
$date=`date -I`; chomp($date); |
$date=`date -I`; chomp($date); |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=~s/\W//g; |
$lonHostID=~s/\W//g; |
$lineexistflag=0; |
$lineexistflag=0; |
$hostidexistflag=0; |
$hostidexistflag=0; |
if ($choice==1) { |
$line2insert=<<END; |
$lonCluster='production'; $flag=1; |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription |
} |
END |
elsif ($choice==2) { |
if ($lonCluster eq 'standalone') { |
$lonCluster='standalone'; $flag=1; |
|
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
die('file generation error'); |
die('file generation error'); |
print(OUT $line2insert); |
print(OUT $line2insert); |
close(OUT); |
close(OUT); |
} |
} |
elsif ($choice==3) { |
|
$lonCluster='development'; $flag=1; |
|
} |
|
elsif ($choice==4) { |
|
$lonCluster='existing'; $flag=1; |
|
if (-e '/home/httpd/lonTabs/hosts.tab') { |
|
`cp /home/httpd/lonTabs/hosts.tab ../existing_hosts.tab`; |
|
} |
|
else { |
|
print <<END; |
|
There is no existing /home/httpd/lonTabs/hosts.tab |
|
END |
|
die(''); |
|
} |
|
} |
|
elsif ($choice==26) { |
|
$lonCluster='rawhide'; $flag=1; |
|
} |
|
if ($flag==1) { |
if ($flag==1) { |
`rm -f ../hosts.tab`; |
`rm -f ../hosts.tab`; |
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
Line 636 END
|
Line 685 END
|
} |
} |
} |
} |
} |
} |
|
|
} |
|
</perlscript> |
</perlscript> |
</file> |
</file> |
</files> |
</files> |