Diff for /doc/install/linux/install.pl between versions 1.45.2.2 and 1.45.2.3

version 1.45.2.2, 2019/02/19 19:24:28 version 1.45.2.3, 2019/07/07 23:37:54
Line 164  sub get_user_selection { Line 164  sub get_user_selection {
 sub get_distro {  sub get_distro {
     my ($distro,$gotprereqs,$updatecmd,$packagecmd,$installnow,$unknown);      my ($distro,$gotprereqs,$updatecmd,$packagecmd,$installnow,$unknown);
     $packagecmd = '/bin/rpm -q LONCAPA-prerequisites ';      $packagecmd = '/bin/rpm -q LONCAPA-prerequisites ';
     if (-e '/etc/redhat-release') {      if (-e '/etc/oracle-release') {
           open(IN,'</etc/oracle-release');
           my $versionstring=<IN>;
           chomp($versionstring);
           close(IN);
           if ($versionstring =~ /^Oracle Linux Server release (\d+)/) {
               my $version = $1;
               $distro = 'oracle'.$1;
               $updatecmd = 'yum install LONCAPA-prerequisites';
               $installnow = 'yum -y install LONCAPA-prerequisites';
           }
       } elsif (-e '/etc/redhat-release') {
         open(IN,'</etc/redhat-release');          open(IN,'</etc/redhat-release');
         my $versionstring=<IN>;          my $versionstring=<IN>;
         chomp($versionstring);          chomp($versionstring);
Line 194  sub get_distro { Line 205  sub get_distro {
             $distro = 'rhes'.$1;              $distro = 'rhes'.$1;
             $updatecmd = 'yum install LONCAPA-prerequisites';              $updatecmd = 'yum install LONCAPA-prerequisites';
             $installnow = 'yum -y install LONCAPA-prerequisites';              $installnow = 'yum -y install LONCAPA-prerequisites';
           } elsif ($versionstring =~ /Red Hat Enterprise Linux release (\d+)/) {
               $distro = 'rhes'.$1;
               $updatecmd = 'dnf install LONCAPA-prerequisites';
               $installnow = 'dnf -y install LONCAPA-prerequisites';
         } elsif ($versionstring =~ /CentOS(?:| Linux) release (\d+)/) {          } elsif ($versionstring =~ /CentOS(?:| Linux) release (\d+)/) {
             $distro = 'centos'.$1;              $distro = 'centos'.$1;
             $updatecmd = 'yum install LONCAPA-prerequisites';              $updatecmd = 'yum install LONCAPA-prerequisites';
Line 306  sub get_distro { Line 321  sub get_distro {
                 $unknown = 1;                  $unknown = 1;
             }              }
         } else {          } else {
             print &mt('Unknown installation: expecting a debian, ubuntu, suse, sles, redhat, fedora or scientific linux system.')."\n";              print &mt('Unknown installation: expecting a debian, ubuntu, suse, sles, redhat, fedora, scientific linux, or oracle linux system.')."\n";
         }          }
     }      }
     return ($distro,$packagecmd,$updatecmd,$installnow);      return ($distro,$packagecmd,$updatecmd,$installnow);
Line 372  sub check_locale { Line 387  sub check_locale {
             print &mt('Failed to open: [_1], default locale not checked.',              print &mt('Failed to open: [_1], default locale not checked.',
                       '/etc/sysconfig/i18n');                        '/etc/sysconfig/i18n');
         }          }
     } elsif ($distro =~ /^(?:rhes|centos|scientific)(\d+)/) {      } elsif ($distro =~ /^(?:rhes|centos|scientific|oracle)(\d+)/) {
         if ($1 >= 7) {          if ($1 >= 7) {
             if (!open($fh,"</etc/locale.conf")) {              if (!open($fh,"</etc/locale.conf")) {
                 print &mt('Failed to open: [_1], default locale not checked.',                  print &mt('Failed to open: [_1], default locale not checked.',
Line 401  sub check_locale { Line 416  sub check_locale {
                     $command = 'sudo locale-gen en_US.UTF-8'."\n".                      $command = 'sudo locale-gen en_US.UTF-8'."\n".
                                'sudo update-locale LANG=en_US.UTF-8';                                 'sudo update-locale LANG=en_US.UTF-8';
                 } elsif ($distro =~ /^(suse|sles)/) {                  } elsif ($distro =~ /^(suse|sles)/) {
                     $command = 'yast language';                       $command = 'yast language';
                 } else {                  } elsif (-e '/usr/bin/system-config-language') {
                     $command = 'system-config-language';                      $command = 'system-config-language';
                   } elsif (-e '/usr/bin/localectl') {
                       $command = 'localectl set-locale en_US.UTF-8';
                   } else {
                       $command = 'No standard command found';
                 }                  }
             }              }
             last;              last;
Line 499  sub check_mysql_running { Line 518  sub check_mysql_running {
         if ($1 >= 19) {          if ($1 >= 19) {
             $mysqldaemon ='mariadb';              $mysqldaemon ='mariadb';
         }          }
     } elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) {      } elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) {
         if ($1 >= 7) {          if ($1 >= 7) {
             $mysqldaemon ='mariadb';              $mysqldaemon ='mariadb';
             $process = 'mysqld';              $process = 'mysqld';
Line 640  sub chkconfig { Line 659  sub chkconfig {
         if ($version >= 19) {          if ($version >= 19) {
             $daemon{'mysql'} = 'mariadb';              $daemon{'mysql'} = 'mariadb';
         }          }
     } elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) {      } elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) {
         my $version = $1;          my $version = $1;
         if ($version >= 7) {          if ($version >= 7) {
             $uses_systemctl{'ntp'} = 1;              $uses_systemctl{'ntp'} = 1;
Line 650  sub chkconfig { Line 669  sub chkconfig {
             $uses_systemctl{'cups'} = 1;              $uses_systemctl{'cups'} = 1;
             $daemon{'mysql'} = 'mariadb';              $daemon{'mysql'} = 'mariadb';
         }          }
           if (($version >= 8) || ($distro eq 'oracle7')) {
               $daemon{'ntp'} = 'chronyd';
           }
     }      }
     my $nocheck;      my $nocheck;
     if (! -x $checker_bin) {      if (! -x $checker_bin) {
Line 744  sub chkconfig { Line 766  sub chkconfig {
   
 sub uses_firewalld {  sub uses_firewalld {
     my ($distro) = @_;      my ($distro) = @_;
     my ($inuse, $checkfirewalld);      my ($inuse,$checkfirewalld,$zone);
     if ($distro =~ /^(suse|sles)([\d\.]+)$/) {      if ($distro =~ /^(suse|sles)([\d\.]+)$/) {
         if (($1 eq 'sles') && ($2 >= 15)) {          if (($1 eq 'sles') && ($2 >= 15)) {
             $checkfirewalld = 1;              $checkfirewalld = 1;
Line 753  sub uses_firewalld { Line 775  sub uses_firewalld {
         if ($1 >= 18) {          if ($1 >= 18) {
             $checkfirewalld = 1;              $checkfirewalld = 1;
         }          }
     } elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) {      } elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) {
         if ($1 >= 7) {          if ($1 >= 7) {
             $checkfirewalld = 1;              $checkfirewalld = 1;
         }          }
Line 774  sub uses_firewalld { Line 796  sub uses_firewalld {
         }          }
         if (($loaded eq 'loaded') || ($active eq 'active')) {          if (($loaded eq 'loaded') || ($active eq 'active')) {
             $inuse = 1;              $inuse = 1;
               my $cmd = 'firewall-cmd --get-default-zone';
               if (open(PIPE,"$cmd |")) {
                   my $result = <PIPE>;
                   chomp($result);
                   close(PIPE);
                   if ($result =~ /^\w+$/) {
                       $zone = $result;
                   }
               }
         }          }
     }      }
     return $inuse;      return ($inuse,$zone);
 }  }
   
 sub chkfirewall {  sub chkfirewall {
Line 787  sub chkfirewall { Line 818  sub chkfirewall {
                     https => 443,                      https => 443,
                 );                  );
     my %activefw;      my %activefw;
     if (&firewall_is_active()) {      my ($firewalld,$zone) = &uses_firewalld($distro);
         if (&uses_firewalld($distro)) {      if ($firewalld) {
             my %current;          my %current;
             if (open(PIPE,'firewall-cmd --permanent --zone=public --list-services |')) {          if (open(PIPE,'firewall-cmd --permanent --zone='.$zone.' --list-services |')) {
                 my $svc = <PIPE>;              my $svc = <PIPE>;
                 close(PIPE);              close(PIPE);
                 chomp($svc);              chomp($svc);
                 map { $current{$_} = 1; } (split(/\s+/,$svc));              map { $current{$_} = 1; } (split(/\s+/,$svc));
             }          }
             if ($current{'http'} && $current{'https'}) {          if ($current{'http'} && $current{'https'}) {
                 $configfirewall = 0;              $configfirewall = 0;
             }          }
         } else {      } else {
           if (&firewall_is_active()) {
             my $iptables = &get_pathto_iptables();              my $iptables = &get_pathto_iptables();
             if ($iptables eq '') {              if ($iptables eq '') {
                 print &mt('Firewall not checked as path to iptables not determined.')."\n";                  print &mt('Firewall not checked as path to iptables not determined.')."\n";
Line 821  sub chkfirewall { Line 853  sub chkfirewall {
                     print &mt('Firewall not checked as iptables Chains not identified.')."\n";                      print &mt('Firewall not checked as iptables Chains not identified.')."\n";
                 }                  }
             }              }
           } else {
               print &mt('Firewall not enabled.')."\n";
         }          }
     } else {  
         print &mt('Firewall not enabled.')."\n";  
     }      }
     return ($configfirewall,\%activefw);      return ($configfirewall,\%activefw);
 }  }
Line 921  sub chkapache { Line 953  sub chkapache {
         }          }
     } else {      } else {
         my $configfile = 'httpd.conf';          my $configfile = 'httpd.conf';
         if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) {          if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) {
             if ($1 >= 7) {              if ($1 >= 7) {
                 $configfile = 'apache2.4/httpd.conf';                  $configfile = 'apache2.4/httpd.conf';
             } elsif ($1 > 5) {              } elsif ($1 > 5) {
Line 1407  if ($distro eq '') { Line 1439  if ($distro eq '') {
     print "\n".&mt('Linux distribution could not be verified as a supported distribution.')."\n".      print "\n".&mt('Linux distribution could not be verified as a supported distribution.')."\n".
           &mt('The following are supported: [_1].',            &mt('The following are supported: [_1].',
               'CentOS, RedHat Enterprise, Fedora, Scientific Linux, '.                'CentOS, RedHat Enterprise, Fedora, Scientific Linux, '.
               'openSuSE, SLES, Ubuntu LTS, Debian')."\n\n".                'Oracle Linux, openSuSE, SLES, Ubuntu LTS, Debian')."\n\n".
           &mt('Stopping execution.')."\n";            &mt('Stopping execution.')."\n";
     exit;      exit;
 }  }
Line 1608  if ($callsub{'runlevels'}) { Line 1640  if ($callsub{'runlevels'}) {
 }  }
   
 if ($callsub{'firewall'}) {  if ($callsub{'firewall'}) {
     if (&uses_firewalld($distro)) {      my ($firewalld,$zone) = &uses_firewalld($distro);
       if ($firewalld) {
         my (%current,%added);          my (%current,%added);
         if (open(PIPE,'firewall-cmd --permanent --zone=public --list-services |')) {          if (open(PIPE,"firewall-cmd --permanent --zone=$zone --list-services |")) {
             my $svc = <PIPE>;              my $svc = <PIPE>;
             close(PIPE);              close(PIPE);
             chomp($svc);              chomp($svc);
Line 1618  if ($callsub{'firewall'}) { Line 1651  if ($callsub{'firewall'}) {
         }          }
         foreach my $service ('http','https') {          foreach my $service ('http','https') {
             unless ($current{$service}) {              unless ($current{$service}) {
                 if (open(PIPE,"firewall-cmd --permanent --zone=public --add-service=$service |")) {                  if (open(PIPE,"firewall-cmd --permanent --zone=$zone --add-service=$service |")) {
                     my $result = <PIPE>;                      my $result = <PIPE>;
                     if ($result =~ /^success/) {                      if ($result =~ /^success/) {
                         $added{$service} = 1;                          $added{$service} = 1;
Line 1636  if ($callsub{'firewall'}) { Line 1669  if ($callsub{'firewall'}) {
         }          }
         unless ($current{'ssh'}) {          unless ($current{'ssh'}) {
             print &mt('If you would the like to allow access to ssh from outside, use the command[_1].',              print &mt('If you would the like to allow access to ssh from outside, use the command[_1].',
                   'firewall-cmd --permanent --zone=public --add-service=ssh')."\n";                    "firewall-cmd --permanent --zone=$zone --add-service=ssh")."\n";
         }          }
     } elsif ($distro =~ /^(suse|sles)/) {      } elsif ($distro =~ /^(suse|sles)/) {
         print &mt('Use [_1] to configure the firewall to allow access for [_2].',          print &mt('Use [_1] to configure the firewall to allow access for [_2].',
Line 1658  if ($callsub{'firewall'}) { Line 1691  if ($callsub{'firewall'}) {
                 }                  }
             }              }
         }          }
     } elsif ($distro =~ /^scientific/) {      } elsif ($distro =~ /^(scientific|oracle)/) {
         print &mt('Use [_1] to configure the firewall to allow access for [_2].',          print &mt('Use [_1] to configure the firewall to allow access for [_2].',
                   'system-config-firewall-tui -- Customize',                    'system-config-firewall-tui -- Customize',
                   'ssh, http')."\n";                    'ssh, http')."\n";
     } else {      } else {
         print &mt('Use [_1] to configure the firewall to allow access for [_2].',          my $version;
                   'setup -- Firewall configuration -> Customize',          if ($distro =~ /^(redhat|centos)(\d+)$/) {
                   'ssh, http, https')."\n";              $version = $1;
           }
           if ($version > 5) {
               print &mt('Use [_1] to configure the firewall to allow access for [_2].',
                     'system-config-firewall-tui -- Customize',
                     'ssh, http')."\n";
           } else {
               print &mt('Use [_1] to configure the firewall to allow access for [_2].',
                         'setup -- Firewall configuration -> Customize',
                         'ssh, http, https')."\n";
           }
     }      }
 } else {  } else {
     &print_and_log(&mt('Skipping Firewall configuration.')."\n");      &print_and_log(&mt('Skipping Firewall configuration.')."\n");
Line 2098  sub get_mysql_version { Line 2141  sub get_mysql_version {
 sub copy_httpd_conf {  sub copy_httpd_conf {
     my ($instdir,$distro) = @_;      my ($instdir,$distro) = @_;
     my $configfile = 'httpd.conf';      my $configfile = 'httpd.conf';
     if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) {      if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) {
         if ($1 >= 7) {          if ($1 >= 7) {
             $configfile = 'apache2.4/httpd.conf';              $configfile = 'apache2.4/httpd.conf';
         } elsif ($1 > 5) {          } elsif ($1 > 5) {

Removed from v.1.45.2.2  
changed lines
  Added in v.1.45.2.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>