--- loncom/Attic/lonManage 2003/10/28 11:55:58 1.18 +++ loncom/Attic/lonManage 2003/11/03 10:18:13 1.19 @@ -3,9 +3,9 @@ # # lonManage supports remote management of nodes in a LonCAPA cluster. # -# $Id: lonManage,v 1.18 2003/10/28 11:55:58 foxr Exp $ +# $Id: lonManage,v 1.19 2003/11/03 10:18:13 foxr Exp $ # -# $Id: lonManage,v 1.18 2003/10/28 11:55:58 foxr Exp $ +# $Id: lonManage,v 1.19 2003/11/03 10:18:13 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -71,8 +71,8 @@ use LondConnection; my %perlvar; # Perl variable defs from apache config. my %hostshash; # Host table as a host indexed hash. -my $MyHost; # Host name to use as me. -my $ForeignHostTab; # Name of foreign hosts table. +my $MyHost=""; # Host name to use as me. +my $ForeignHostTab=""; # Name of foreign hosts table. # # prints out utility's command usage info. @@ -227,14 +227,26 @@ sub ParseArgs { return @result; } # -# Read the loncapa configuration stuff. +# Read the loncapa configuration stuff. If ForeignHostTab is empty, +# assume we are part of a loncapa cluster and read the hosts.tab +# file from the config directory. Otherwise, ForeignHossTab +# is the name of an alternate configuration file to read in +# standalone mode. # sub ReadConfig { - my $perlvarref = LondConnection::read_conf('loncapa.conf'); - %perlvar = %{$perlvarref}; - my $hoststab = LondConnection::read_hosts( - "$perlvar{'lonTabDir'}/hosts.tab"); - %hostshash = %{$hoststab}; + + if($ForeignHostTab eq "") { + my $perlvarref = LondConnection::read_conf('loncapa.conf'); + %perlvar = %{$perlvarref}; + my $hoststab = LondConnection::read_hosts( + "$perlvar{'lonTabDir'}/hosts.tab"); + %hostshash = %{$hoststab}; + } else { + my $hoststab = LondConnection::read_hosts($ForeignHostTab); + %hostshash = %{$hoststab}; + $perlvar{londPort} = 5663; + $perlvar{lonSockDir} = "/home/httpd/sockets"; + } } # @@ -388,7 +400,6 @@ sub ReinitProcess { } #--------------------------- Entry point: -------------------------- -ReadConfig; # Read the configuration info (incl.hosts). # Parse the parameters @@ -408,6 +419,11 @@ if ($EUID != 0) { die "ENOPRIV - No privilege for requested operation" } +# +# Read the configuration file. +# + +ReadConfig; # Read the configuration info (incl.hosts). # Based on the operation requested invoke the appropriate function: