[LON-CAPA-cvs] cvs: loncom / lond
foxr
lon-capa-cvs@mail.lon-capa.org
Tue, 16 Sep 2003 10:13:20 -0000
foxr Tue Sep 16 06:13:20 2003 EDT
Modified files:
/loncom lond
Log:
Added ReinitProcess function to oversee the parsing and processing of the
reinit:<process> client request.
Index: loncom/lond
diff -u loncom/lond:1.144 loncom/lond:1.145
--- loncom/lond:1.144 Tue Sep 16 05:47:01 2003
+++ loncom/lond Tue Sep 16 06:13:20 2003
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.144 2003/09/16 09:47:01 foxr Exp $
+# $Id: lond,v 1.145 2003/09/16 10:13:20 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,10 @@
# 09/08/2003 Ron Fox: Told lond to take care of change logging so we
# don't have to remember it:
# $Log: lond,v $
+# Revision 1.145 2003/09/16 10:13:20 foxr
+# Added ReinitProcess function to oversee the parsing and processing of the
+# reinit:<process> client request.
+#
# Revision 1.144 2003/09/16 09:47:01 foxr
# Added skeletal support for SIGUSR2 (update hosts.tab)
#
@@ -100,7 +104,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.144 $'; #' stupid emacs
+my $VERSION='$Revision: 1.145 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid;
my $currentdomainid;
@@ -338,7 +342,7 @@
if(!InstallFile($tablefile, $contents)) {
&logthis('<font color="red"> Pushfile: unable to install '
- .$tablefile." $! </font>");
+ .$tablefile." $! </font>");
return "error:$!";
}
else {
@@ -353,6 +357,28 @@
return "ok";
}
+
+#
+# Called to re-init either lonc or lond.
+#
+# Parameters:
+# request - The full request by the client. This is of the form
+# reinit:<process>
+# where <process> is allowed to be either of
+# lonc or lond
+#
+# Returns:
+# The string to be sent back to the client either:
+# ok - Everything worked just fine.
+# error:why - There was a failure and why describes the reason.
+#
+#
+sub ReinitProcess {
+ my $request = shift;
+
+ return 'ok';
+}
+
#
# Convert an error return code from lcpasswd to a string value.
#
@@ -952,7 +978,8 @@
if ($wasenc == 1) {
my $cert = GetCertificate($userinput);
if(ValidManager($cert)) {
- print $client "ok\n";
+ my $reply = ReinitProcess($userinput);
+ print $client "$reply\n";
} else {
print $client "refused\n";
}