--- loncom/lond 2011/05/13 02:58:02 1.472
+++ loncom/lond 2011/05/14 15:47:01 1.473
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.472 2011/05/13 02:58:02 raeburn Exp $
+# $Id: lond,v 1.473 2011/05/14 15:47:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,7 +60,7 @@ my $DEBUG = 0; # Non zero to ena
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.472 $'; #' stupid emacs
+my $VERSION='$Revision: 1.473 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -421,7 +421,8 @@ sub ReadManagerTable {
my $tablename = $perlvar{'lonTabDir'}."/managers.tab";
if (!open (MANAGERS, $tablename)) {
- if (&loncapa_dns_server()) {
+ my $hostname = &Apache::lonnet::hostname($perlvar{'lonHostID'});
+ if (&Apache::lonnet::is_LC_dns($hostname)) {
&logthis('No manager table. Nobody can manage!!');
}
return;
@@ -677,7 +678,7 @@ sub PushFile {
return "error:$!";
} else {
&logthis(' Installed new '.$tablefile
- ."");
+ ." - transaction by: $clientname ($clientip)");
my $adminmail = $perlvar{'lonAdmEMail'};
my $admindom = &Apache::lonnet::host_domain($perlvar{'lonHostID'});
if ($admindom ne '') {
@@ -691,16 +692,12 @@ sub PushFile {
}
if ($adminmail =~ /^[^\@]+\@[^\@]+$/) {
my $msg = new Mail::Send;
- my $senderaddress = $perlvar{'lonSysEMail'};
$msg->to($adminmail);
$msg->subject('LON-CAPA DNS update on '.$perlvar{'lonHostID'});
- if ($senderaddress) {
- $msg->add('From',$senderaddress);
- }
$msg->add('Content-type','text/plain; charset=UTF-8');
if (my $fh = $msg->open()) {
print $fh 'Update to '.$tablefile.' from Cluster Manager '.
- $client."\n";
+ "$clientname ($clientip)\n";
$fh->close;
}
}
@@ -712,25 +709,6 @@ sub PushFile {
}
-sub loncapa_dns_server {
- my $lonhost = &Apache::lonnet::get_host_ip($perlvar{'lonHostID'});
- my $hoststable = "$perlvar{'lonTabDir'}/hosts.tab";
- my $is_dns_server;
- if (!open(HOSTS,"<$hoststable")) {
- &logthis('Could not open hosts.tab to check for LON-CAPA DNS servers.');
- while (my $host = ) {
- chomp($host);
- $host =~ s/(^\s+|\s+$)//g;
- if ($host =~ /^\Q^$lonhost\E/) {
- $is_dns_server = 1;
- last;
- }
- }
- close(HOSTS);
- }
- return $is_dns_server;
-}
-
#
# Called to re-init either lonc or lond.
#
@@ -6114,6 +6092,7 @@ sub HUPSMAN { # sig
# a setuid perl script that can be root for us to do this job.
#
sub ReloadApache {
+# --------------------------- Handle case of another apachereload process (locking)
my $execdir = $perlvar{'lonDaemons'};
my $script = $execdir."/apachereload";
system($script);