[LON-CAPA-cvs] cvs: loncom / loncron
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 27 Jan 2006 21:30:53 -0000
albertel Fri Jan 27 16:30:53 2006 EDT
Modified files:
/loncom loncron
Log:
- modifying loncron to have a reply function like lonnets
Index: loncom/loncron
diff -u loncom/loncron:1.63 loncom/loncron:1.64
--- loncom/loncron:1.63 Fri Jan 27 16:27:15 2006
+++ loncom/loncron Fri Jan 27 16:30:53 2006
@@ -2,7 +2,7 @@
# Housekeeping program, started by cron, loncontrol and loncron.pl
#
-# $Id: loncron,v 1.63 2006/01/27 21:27:15 albertel Exp $
+# $Id: loncron,v 1.64 2006/01/27 21:30:53 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,13 +45,13 @@
# -------------------------------------------------- Non-critical communication
sub reply {
- my ($cmd,$server)=@_;
- my $peerfile="$perlvar{'lonSockDir'}/$server";
+ my ($cmd,$server,$hostname)=@_;
+ my $peerfile="$perlvar{'lonSockDir'}/".$hostname->{$server};
my $client=IO::Socket::UNIX->new(Peer =>"$peerfile",
Type => SOCK_STREAM,
Timeout => 10)
or return "con_lost";
- print $client "$cmd\n";
+ print $client "sethost:$server:$cmd\n";
my $answer=<$client>;
chomp($answer);
if (!$answer) { $answer="con_lost"; }
@@ -486,7 +486,7 @@
foreach my $tryserver (sort(keys(%{$hostname}))) {
print(".");
my $result;
- my $answer=reply("ping",$tryserver);
+ my $answer=reply("ping",$tryserver,$hostname);
if ($answer eq "$tryserver:$perlvar{'lonHostID'}") {
$result="<b>ok</b>";
$good++;