[LON-CAPA-cvs] cvs: loncom / loncron /configuration Firewall.pm

bisitz bisitz at source.lon-capa.org
Mon Mar 17 10:47:46 EDT 2014


bisitz		Mon Mar 17 14:47:46 2014 EDT

  Modified files:              
    /loncom	loncron 
    /loncom/configuration	Firewall.pm 
  Log:
  Consistent case and punctuation of output text
  
  
  
-------------- next part --------------
Index: loncom/loncron
diff -u loncom/loncron:1.99 loncom/loncron:1.100
--- loncom/loncron:1.99	Wed May 29 18:10:54 2013
+++ loncom/loncron	Mon Mar 17 14:47:38 2014
@@ -2,7 +2,7 @@
 
 # Housekeeping program, started by cron, loncontrol and loncron.pl
 #
-# $Id: loncron,v 1.99 2013/05/29 18:10:54 raeburn Exp $
+# $Id: loncron,v 1.100 2014/03/17 14:47:38 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -526,7 +526,7 @@
 sub rotate_lonnet_logs {
     my ($fh)=@_;
     &log($fh,'<hr /><a name="lonnet" /><h2>lonnet</h2><h3>Temp Log</h3><pre>');
-    print "checking logs\n";
+    print "Checking logs.\n";
     if (-e "$perlvar{'lonDaemons'}/logs/lonnet.log"){
 	open (DFH,"tail -n50 $perlvar{'lonDaemons'}/logs/lonnet.log|");
 	while (my $line=<DFH>) { 
@@ -570,7 +570,7 @@
 sub test_connections {
     my ($fh)=@_;
     &log($fh,'<hr /><a name="connections" /><h2>Connections</h2>');
-    print "testing connections\n";
+    print "Testing connections.\n";
     &log($fh,"<table border='2'>");
     my ($good,$bad)=(0,0);
     my %hostname = &Apache::lonnet::all_hostnames();
@@ -604,7 +604,7 @@
 sub check_delayed_msg {
     my ($fh)=@_;
     &log($fh,'<hr /><a name="delayed" /><h2>Delayed Messages</h2>');
-    print "checking buffers\n";
+    print "Checking buffers.\n";
     
     &log($fh,'<h3>Scanning Permanent Log</h3>');
 
@@ -654,7 +654,7 @@
             };
             if ($@ && $@ =~ m/TIMEOUT/) {
                 &log($fh,"Attempted pong to $tryserver timed out<br />");
-                print "time out while contacting: $tryserver for pong\n";
+                print "Time out while contacting: $tryserver for pong.\n";
             } else {
                 &log($fh,"Pong to $tryserver: $answer<br />");
             }
@@ -673,7 +673,7 @@
     my $now=time;
     my $date=localtime($now);
     &log($fh,"<hr />$date ($now)</body></html>\n");
-    print "lon-status webpage updated\n";
+    print "lon-status webpage updated.\n";
     $fh->close();
 
     if ($errors) { $simplestatus{'errors'}=$errors; }
@@ -694,7 +694,7 @@
 }
 
 sub write_loncaparevs {
-    print "Retrieving LON-CAPA version information\n";
+    print "Retrieving LON-CAPA version information.\n";
     my %hostname = &Apache::lonnet::all_hostnames();
     my $output;
     foreach my $id (sort(keys(%hostname))) {
@@ -708,7 +708,7 @@
                 alarm(0);
             };
             if ($@ && $@ =~ m/TIMEOUT/) {
-                print "time out while contacting lonHost: $id for version\n";   
+                print "Time out while contacting lonHost: $id for version.\n";   
             }
             if ($loncaparev =~ /^[\w.\-]+$/) {
                 $output .= $id.':'.$loncaparev."\n";
@@ -726,7 +726,7 @@
 }
 
 sub write_serverhomeIDs {
-    print "Retrieving LON-CAPA lonHostID information\n";
+    print "Retrieving LON-CAPA lonHostID information.\n";
     my %name_to_host = &Apache::lonnet::all_names();
     my $output;
     foreach my $name (sort(keys(%name_to_host))) {
@@ -782,7 +782,7 @@
 }
 
 sub send_mail {
-    print "sending mail\n";
+    print "Sending mail.\n";
     my $defdom = $perlvar{'lonDefDomain'};
     my $origmail = $perlvar{'lonAdmEMail'};
     my $emailto = &Apache::loncommon::build_recipient_list(undef,
@@ -800,7 +800,7 @@
 
 sub usage {
     print(<<USAGE);
-loncron - housekeeping program that checks up on various parts of Lon-CAPA
+loncron - housekeeping program that checks up on various parts of LON-CAPA
 
 Options:
    --help     Display 
@@ -856,10 +856,10 @@
 # ----------------------------- Make sure this process is running from user=www
     my $wwwid=getpwnam('www');
     if ($wwwid!=$<) {
-	print("User ID mismatch.  This program must be run as user 'www'\n");
+	print("User ID mismatch. This program must be run as user 'www'.\n");
 	my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
 	my $subj="LON: $perlvar{'lonHostID'} User ID mismatch";
-	system("echo 'User ID mismatch.  loncron must be run as user www.' |\
+	system("echo 'User ID mismatch. loncron must be run as user www.' |\
  mailto $emailto -s '$subj' > /dev/null");
 	exit 1;
     }
Index: loncom/configuration/Firewall.pm
diff -u loncom/configuration/Firewall.pm:1.13 loncom/configuration/Firewall.pm:1.14
--- loncom/configuration/Firewall.pm:1.13	Sun Sep 22 15:50:35 2013
+++ loncom/configuration/Firewall.pm	Mon Mar 17 14:47:46 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Firewall configuration to allow internal LON-CAPA communication between servers   
 #
-# $Id: Firewall.pm,v 1.13 2013/09/22 15:50:35 raeburn Exp $
+# $Id: Firewall.pm,v 1.14 2014/03/17 14:47:46 bisitz Exp $
 #
 # The LearningOnline Network with CAPA
 #
@@ -51,7 +51,7 @@
         }
     }
     if (!@okchains) {
-        return 'None of the chain names has the expected format'."\n";
+        return 'None of the chain names has the expected format.'."\n";
     }
     if (ref($ports) ne 'ARRAY') {
         return 'List of ports to open needed.';
@@ -61,7 +61,7 @@
         if ($portnum =~ /^(\d+)$/) {
             $port = $1;
         } else {
-            print "Skipped non-numeric port: $portnum\n";
+            print "Skipped non-numeric port: $portnum.\n";
             next;
         }
         print "Opening firewall access on port $port.\n";
@@ -84,11 +84,11 @@
                             if (($1<=255) && ($2<=255) && ($3<=255) && ($4<=255)) {
                                 $ip = "$1.$2.$3.$4";
                             } else {
-                                print "IP address: $key does not have expected format\n";
+                                print "IP address: $key does not have expected format.\n";
                                 next;
                             }
                         } else {
-                            print "IP address: $key does not have expected format\n";
+                            print "IP address: $key does not have expected format.\n";
                             next;
                         }
                         if ($curropen{$ip}) {
@@ -122,13 +122,13 @@
                 unless (grep(/^\Q$port\E$/, at opened)) {
                     push(@opened,$port);
                 }
-                print "Port already open for ".scalar(@lond_port_curropen)." IP addresses\n";
+                print "Port already open for ".scalar(@lond_port_curropen)." IP addresses.\n";
             }
             if (@lond_port_open) {
                 unless (grep(/^\Q$port\E$/, at opened)) {   
                     push(@opened,$port);
                 }
-                print "Port opened for ".scalar(@lond_port_open)." IP addresses\n";
+                print "Port opened for ".scalar(@lond_port_open)." IP addresses.\n";
             }
             if (@port_error) {
                 print "Error opening port for following IP addresses: ".join(', ', at port_error)."\n";
@@ -238,7 +238,7 @@
         }
     }
     if (!@okchains) {
-        return 'None of the chain names has the expected format'."\n";
+        return 'None of the chain names has the expected format.'."\n";
     }
     if (ref($ports) ne 'ARRAY') {
         return 'List of ports to close needed.';
@@ -292,7 +292,7 @@
                     }
                 }
                 if (@lond_port_close) {
-                    $output .= "Port closed for ".scalar(@lond_port_close)." IP addresses\n";
+                    $output .= "Port closed for ".scalar(@lond_port_close)." IP addresses.\n";
                 }
                 if (@port_error) {
                     $output .= "Error closing port for following IP addresses: ".join(', ', at port_error)."\n";
@@ -353,7 +353,7 @@
                 system($firewall_command);
                 my $return_status = $?>>8;
                 if ($return_status == 1) {
-                    print 'Error closing port '.$port.' for source "anywhere"'."\n";
+                    print 'Error closing port '.$port.' for source "anywhere".'."\n";
                 } elsif ($return_status == 2) {
                     print 'Bad command error closing port '.$port.' for source "anywhere".  Command was'."\n".
                           ' '.$firewall_command."\n";
@@ -401,7 +401,7 @@
             if (!-e '/etc/sysconfig/iptables') {
                 if (!-e '/var/lib/iptables') {
                     unless ($distro =~ /^(debian|ubuntu)/) {
-                        print("Unable to find iptables file containing static definitions\n");
+                        print("Unable to find iptables file containing static definitions.\n");
                     }
                 }
                 if ($distro =~ /^(fedora|rhes|centos|scientific)/) {
@@ -441,7 +441,7 @@
     } elsif (-e '/usr/sbin/iptables') {
         $iptables = '/usr/sbin/iptables';
     } else {
-        print("Unable to find iptables command\n");
+        print("Unable to find iptables command.\n");
     }
     return $iptables;
 }


More information about the LON-CAPA-cvs mailing list