[LON-CAPA-cvs] cvs: loncom / lond

raeburn raeburn@source.lon-capa.org
Fri, 13 May 2011 02:32:41 -0000


raeburn		Fri May 13 02:32:41 2011 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Routine to report distro/architecture of a LON-CAPA server.
  
  
Index: loncom/lond
diff -u loncom/lond:1.470 loncom/lond:1.471
--- loncom/lond:1.470	Sat Jan 22 21:10:18 2011
+++ loncom/lond	Fri May 13 02:32:40 2011
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.470 2011/01/22 21:10:18 raeburn Exp $
+# $Id: lond,v 1.471 2011/05/13 02:32:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,7 +59,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.470 $'; #' stupid emacs
+my $VERSION='$Revision: 1.471 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -1669,6 +1669,15 @@
 }
 &register_handler("serverhomeID", \&server_homeID_handler, 0, 1, 0);
 
+sub server_distarch_handler {
+    my ($cmd,$tail,$client) = @_;
+    my $userinput = "$cmd:$tail";
+    my $reply = &distro_and_arch();
+    &Reply($client,\$reply,$userinput);
+    return 1;
+}
+&register_handler("serverdistarch", \&server_distarch_handler, 0, 1, 0);
+
 #   Process a reinit request.  Reinit requests that either
 #   lonc or lond be reinitialized so that an updated 
 #   host.tab or domain.tab can be processed.
@@ -6331,6 +6340,11 @@
 
 my $dist=`$perlvar{'lonDaemons'}/distprobe`;
 
+my $arch = `uname -i`;
+if ($arch eq 'unknown') {
+    $arch = `uname -m`;
+}
+
 # --------------------------------------------------------------
 #   Accept connections.  When a connection comes in, it is validated
 #   and if good, a child process is created to process transactions
@@ -7477,6 +7491,10 @@
     return 1;
 }
 
+sub distro_and_arch {
+    return $dist.':'.$arch;
+}
+
 # ----------------------------------- POD (plain old documentation, CPAN style)
 
 =head1 NAME