[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /init.d loncontrol

raeburn raeburn at source.lon-capa.org
Sun Jul 7 16:49:02 EDT 2019


raeburn		Sun Jul  7 20:49:02 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/init.d	loncontrol 
  Log:
  - For 2.11
    Backport 1.46
  
  
Index: loncom/init.d/loncontrol
diff -u loncom/init.d/loncontrol:1.44 loncom/init.d/loncontrol:1.44.2.1
--- loncom/init.d/loncontrol:1.44	Sun Sep 20 18:31:33 2015
+++ loncom/init.d/loncontrol	Sun Jul  7 20:49:02 2019
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: loncontrol,v 1.44 2015/09/20 18:31:33 raeburn Exp $
+# $Id: loncontrol,v 1.44.2.1 2019/07/07 20:49:02 raeburn Exp $
 #
 # The LearningOnline Network with CAPA
 #
@@ -112,6 +112,7 @@
     my $iptables = &LONCAPA::Firewall::get_pathto_iptables();
     my @fw_chains = &LONCAPA::Firewall::get_fw_chains($iptables);
     my $lond_port = &LONCAPA::Firewall::get_lond_port();
+    my $firewalld = &LONCAPA::Firewall::uses_firewalld();
     my %iphost;
     if ($command eq 'restart') {
         print 'Restarting LON-CAPA'."\n";
@@ -124,13 +125,15 @@
         %iphost = &Apache::lonnet::get_iphost('',1);
         my $firewall_result =
             &LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,
-                                             $lond_port,\%iphost,[$lond_port]);
+                                             $lond_port,\%iphost,[$lond_port],
+                                             $firewalld);
         if ($firewall_result) {
             print "$firewall_result\n";
         }
         $firewall_result =
             &LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains,
-                                            $lond_port, \%iphost,[$lond_port]);
+                                            $lond_port, \%iphost,[$lond_port],
+                                            $firewalld);
         if (($firewall_result eq 'ok') || ($firewall_result eq 'inactive firewall')) {
             if ($firewall_result eq 'inactive firewall') {
                 print "WARNING: iptables firewall is currently inactive\n";
@@ -149,7 +152,9 @@
 	    &stop_daemon($daemon,$killallname);
         }
         my $firewall_result = 
-            &LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]);
+            &LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,
+                                                    $lond_port,\%iphost,[$lond_port],
+                                                    $firewalld);
         if ($firewall_result) {
             print "$firewall_result\n";
         }
@@ -157,7 +162,9 @@
     } elsif ($command eq "start") {
         %iphost = &Apache::lonnet::get_iphost('',1);
         my $firewall_result = 
-            &LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]);
+            &LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains,
+                                                   $lond_port,\%iphost,[$lond_port],
+                                                   $firewalld);
         if (($firewall_result eq 'ok') || ($firewall_result eq 'inactive firewall')) {
             if ($firewall_result eq 'inactive firewall') {
                 print "WARNING: iptables firewall is currently inactive\n";
@@ -189,12 +196,12 @@
         if ($lond_port) {
             my $londopen;
             foreach my $fw_chain (@fw_chains) { 
-                my $numopen = &LONCAPA::Firewall::firewall_is_port_open($iptables,$fw_chain,$lond_port,$lond_port,\%iphost);
+                my $numopen = &LONCAPA::Firewall::firewall_is_port_open($iptables,$fw_chain,$lond_port,$lond_port,\%iphost,$firewalld);
                 $londopen += $numopen; 
             }
             if ($londopen) {
                 print "The LON-CAPA port ($lond_port) is open in firewall.\n";
-            } elsif (&LONCAPA::Firewall::firewall_is_active) {
+            } elsif (&LONCAPA::Firewall::firewall_is_active()) {
                 print "The LON-CAPA port ($lond_port) is NOT open in running firewall!\n";
             }
         } else {




More information about the LON-CAPA-cvs mailing list