[LON-CAPA-cvs] cvs: doc /install/linux install.pl

raeburn raeburn@source.lon-capa.org
Sun, 24 Apr 2011 01:25:13 -0000


This is a MIME encoded message

--raeburn1303608313
Content-Type: text/plain

raeburn		Sun Apr 24 01:25:13 2011 EDT

  Modified files:              
    /doc/install/linux	install.pl 
  Log:
  - Enable use of a single install.tar file for all supported Linux 
    distros/versions when preparing systems for LON-CAPA installation.
    - files needed for installation fall into three groups:
     (a) file needed by all distros - pwauth-2.2.8.tar.gz - found in $instdir
     (b) localization files - found in $instdir/LCLocalization directory
     (c) files specific to different distros - found in:
         $instdir/centos-rhes-fedora-sl, $instdir/debian-ubuntu, 
         $instdir/sles-suse, and $instdir/rhes4. 
  
  
--raeburn1303608313
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20110424012513.txt"

Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.8 doc/install/linux/install.pl:1.9
--- doc/install/linux/install.pl:1.8	Sat Apr 23 23:35:19 2011
+++ doc/install/linux/install.pl	Sun Apr 24 01:25:13 2011
@@ -72,7 +72,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.8 2011/04/23 23:35:19 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.9 2011/04/24 01:25:13 raeburn Exp $'."\n";
 }
 
 #
@@ -590,11 +590,11 @@
     my ($distro,$instdir) = @_;
     my $fixapache = 1;
     if ($distro =~ /^(debian|ubuntu)/) {
-        if (!-e "$instdir/apache2.conf") {
+        if (!-e "$instdir/debian-ubuntu/apache2.conf") {
             $fixapache = 0;
             print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; 
-        } elsif ((-e "/etc/apache2/sites-available/loncapa") && (-e "$instdir/apache2.conf")) {
-            if (open(PIPE, "diff --brief $instdir/apache2.conf /etc/apache2/sites-available/loncapa |")) {
+        } elsif ((-e "/etc/apache2/sites-available/loncapa") && (-e "$instdir/debian-ubuntu/apache2.conf")) {
+            if (open(PIPE, "diff --brief $instdir/debian-ubuntu/apache2.conf /etc/apache2/sites-available/loncapa |")) {
                 my $diffres = <PIPE>;
                 close(PIPE);
                 chomp($diffres);
@@ -615,11 +615,25 @@
         if ($1 >= 10) {
             $apache = 'apache2';
         }
-        if (!-e "$instdir/default-server.conf") {
+        if (!-e "$instdir/sles-suse/default-server.conf") {
             $fixapache = 0;
             print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n";
-        } elsif ((-e "/etc/$apache/default-server.conf") && (-e "$instdir/default-server.conf")) {
-            if (open(PIPE, "diff --brief $instdir/default-server.conf /etc/$apache/default-server.conf |")) {
+        } elsif ((-e "/etc/$apache/default-server.conf") && (-e "$instdir/sles-suse/default-server.conf")) {
+            if (open(PIPE, "diff --brief $instdir/sles-suse/default-server.conf /etc/$apache/default-server.conf |")) {
+                my $diffres = <PIPE>;
+                close(PIPE);
+                chomp($diffres);
+                unless ($diffres) {
+                    $fixapache = 0;
+                }
+            }
+        }
+    } elsif ($distro eq 'rhes4') {
+        if (!-e "$instdir/rhes4/httpd.conf") {
+            $fixapache = 0;
+            print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n";
+        } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/rhes4/httpd.conf")) {
+            if (open(PIPE, "diff --brief $instdir/rhes4/httpd.conf /etc/httpd/conf/httpd.conf |")) {
                 my $diffres = <PIPE>;
                 close(PIPE);
                 chomp($diffres);
@@ -629,11 +643,11 @@
             }
         }
     } else {
-        if (!-e "$instdir/httpd.conf") {
+        if (!-e "$instdir/centos-rhes-fedora-sl/httpd.conf") {
             $fixapache = 0;
             print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n";
-        } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/httpd.conf")) {
-            if (open(PIPE, "diff --brief $instdir/httpd.conf /etc/httpd/conf/httpd.conf |")) {
+        } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/centos-rhes-fedora-sl/httpd.conf")) {
+            if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/httpd.conf /etc/httpd/conf/httpd.conf |")) {
                 my $diffres = <PIPE>;
                 close(PIPE);
                 chomp($diffres);
@@ -940,8 +954,8 @@
 sub check_SuSEfirewall2_setup {
     my ($instdir) = @_;
     my $need_override = 1;
-    if ((-e "/etc/insserv/overrides/SuSEfirewall2_setup") && (-e "$instdir/SuSEfirewall2_setup")) {
-        if (open(PIPE, "diff --brief $instdir/SuSEfirewall2_setup /etc/insserv/overrides/SuSEfirewall2_setup  |")) {
+    if ((-e "/etc/insserv/overrides/SuSEfirewall2_setup") && (-e "$instdir/sles-suse/SuSEfirewall2_setup")) {
+        if (open(PIPE, "diff --brief $instdir/sles-suse/SuSEfirewall2_setup /etc/insserv/overrides/SuSEfirewall2_setup  |")) {
             my $diffres = <PIPE>;
             close(PIPE);
             chomp($diffres);
@@ -1667,7 +1681,7 @@
     if (-e "$apache2_sites_available_dir/loncapa") {
         copy("$apache2_sites_available_dir/loncapa","$apache2_sites_available_dir/loncapa.original");
     }
-    copy("$instdir/apache2.conf","$apache2_sites_available_dir/loncapa");
+    copy("$instdir/debian-ubuntu/apache2.conf","$apache2_sites_available_dir/loncapa");
     chmod(0444,"$apache2_sites_available_dir/loncapa");
     symlink("$apache2_sites_available_dir/loncapa","$apache2_sites_enabled_dir/000-default");
     my $apache2_mods_enabled_dir = '/etc/apache2/mods-enabled';
@@ -1697,7 +1711,7 @@
     if (!-e "/etc/apache2/default-server.conf.original") {
         copy "/etc/apache2/default-server.conf","/etc/apache2/default-server.conf.original";
     }
-    copy "$instdir/default-server.conf","/etc/apache2/default-server.conf";
+    copy "$instdir/sles-suse/default-server.conf","/etc/apache2/default-server.conf";
     chmod(0444,"/etc/apache2/default-server.conf");
     # Make symlink for conf directory (included in loncapa_apache.conf)
     my $can_symlink = (eval { symlink('/etc/apache2','/srv/www/conf'); }, $@ eq '');
@@ -1724,7 +1738,7 @@
     if (!-e "/etc/apache2/uid.conf.original") {
         copy "/etc/apache2/uid.conf","/etc/apache2/uid.conf.original";
     }
-    copy "$instdir/uid.conf","/etc/apache2/uid.conf";
+    copy "$instdir/sles-suse/uid.conf","/etc/apache2/uid.conf";
     chmod(0444,"/etc/apache2/uid.conf");
 }
 
@@ -1739,7 +1753,7 @@
     if (!-e "/etc/sysconfig/apache2.original") {
         copy "/etc/sysconfig/apache2","/etc/sysconfig/apache2.original";
     }
-    copy "$instdir/sysconfig_apache2","/etc/sysconfig/apache2";
+    copy "$instdir/sles-suse/sysconfig_apache2","/etc/sysconfig/apache2";
     chmod(0444,"/etc/sysconfig/apache2");
 }
 
@@ -1762,7 +1776,7 @@
     } elsif (!-e  "/etc/insserv/overrides/SuSEfirewall2_setup.original") {
         copy "/etc/insserv/overrides/SuSEfirewall2_setup","/etc/insserv/overrides/SuSEfirewall2_setup.original"
     }
-    copy "$instdir/SuSEfirewall2_setup","/etc/insserv/overrides/SuSEfirewall2_setup";
+    copy "$instdir/sles-suse/SuSEfirewall2_setup","/etc/insserv/overrides/SuSEfirewall2_setup";
     chmod(0444,"/etc/insserv/overrides/SuSEfirewall2_setup");
 }
 
@@ -1789,7 +1803,7 @@
     }
     my $ask_to_enable;
     if (-e "/etc/iptables.loncapa.rules") {
-        if (open(PIPE, "diff --brief $instdir/debian/iptables.loncapa.rules /etc/iptables.loncapa.rules |")) {
+        if (open(PIPE, "diff --brief $instdir/debian-ubuntu/iptables.loncapa.rules /etc/iptables.loncapa.rules |")) {
             my $diffres = <PIPE>;
             close(PIPE);
             chomp($diffres);
@@ -1800,14 +1814,14 @@
             print &mt('Error: unable to open [_1] to compare contents with LON-CAPA supplied file.','/etc/iptables.loncapa.rules')."\n";
         }
     } else {
-        if (-e "$instdir/debian/iptables.loncapa.rules") {
-            copy "$instdir/debian/iptables.loncapa.rules","/etc/iptables.loncapa.rules";
+        if (-e "$instdir/debian-ubuntu/iptables.loncapa.rules") {
+            copy "$instdir/debian-ubuntu/iptables.loncapa.rules","/etc/iptables.loncapa.rules";
             chmod(0600,"/etc/iptables.loncapa.rules");
         }
     }
     if (-e "/etc/iptables.loncapa.rules") {
         if (-e "/etc/network/if-pre-up.d/iptables") {
-            if (open(PIPE, "diff --brief $instdir/debian/iptables /etc/network/if-pre-up/iptables |")) {
+            if (open(PIPE, "diff --brief $instdir/debian-ubuntu/iptables /etc/network/if-pre-up/iptables |")) {
                 my $diffres = <PIPE>;
                 close(PIPE);
                 chomp($diffres);
@@ -1818,7 +1832,7 @@
                 print &mt('Error: unable to open [_1] to compare contents with LON-CAPA supplied file.','/etc/network/if-pre-up.d/iptables')."\n";
             }
         } else {
-            copy "$instdir/debian/iptables","/etc/network/if-pre-up.d/iptables";
+            copy "$instdir/debian-ubuntu/iptables","/etc/network/if-pre-up.d/iptables";
             chmod(0755,"/etc/network/if-pre-up.d/iptables");
             print_and_log(&mt('Installed script "[_1]" to add iptables rules to block all ports except 22, 80, and 443 when network is enabled during boot.','/etc/network/if-pre-up.d/iptables'));
             $ask_to_enable = 1;

--raeburn1303608313--