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

raeburn raeburn at source.lon-capa.org
Sun Mar 28 18:10:35 EDT 2021


raeburn		Sun Mar 28 22:10:35 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/install/linux	install.pl 
  Log:
  - For 2.11
    Backport 1.74, 1.75, 1.76
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.45.2.14 doc/install/linux/install.pl:1.45.2.15
--- doc/install/linux/install.pl:1.45.2.14	Sun Mar 28 22:00:27 2021
+++ doc/install/linux/install.pl	Sun Mar 28 22:10:35 2021
@@ -76,7 +76,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.45.2.14 2021/03/28 22:00:27 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.45.2.15 2021/03/28 22:10:35 raeburn Exp $'."\n";
 }
 
 #
@@ -799,13 +799,13 @@
     }
     if ($checkfirewalld) {
         my ($loaded,$active);
-        if (open(PIPE,"systemctl status firewalld |")) {
+        if (open(PIPE,"systemctl status firewalld 2>/dev/null |")) {
             while (<PIPE>) {
                 chomp();
                 if (/^\s*Loaded:\s+(\w+)/) {
                     $loaded = $1;
                 }
-                if (/^\s*Active\s+(\w+)/) {
+                if (/^\s*Active:\s+(\w+)/) {
                     $active = $1;
                 }
             }
@@ -1668,7 +1668,7 @@
 if ($callsub{'mysql'}) {
     if ($dbh) {
         &setup_mysql($callsub{'mysqlperms'},$dbh,$has_pass,
-                     $mysql_unix_socket,$has_lcdb);
+                     $mysql_unix_socket,$has_lcdb,$distro);
     } else {
         print &mt('Unable to configure MySQL because access is denied.')."\n";
     }
@@ -2103,10 +2103,20 @@
 }
 
 sub setup_mysql {
-    my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb) = @_;
+    my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb,$distro) = @_;
     my @mysql_lc_commands;
     unless ($has_lcdb) {
-        push(@mysql_lc_commands,"CREATE DATABASE loncapa");
+        my $createcmd = 'CREATE DATABASE loncapa';
+        if ($distro =~ /^sles(\d+)/) {
+            if ($1 > 11) {
+                $createcmd .= ' CHARACTER SET utf8 COLLATE utf8_general_ci';
+            }
+        } elsif ($distro =~ /^ubuntu(\d+)/) {
+            if ($1 > 16) {
+                $createcmd .= ' CHARACTER SET latin1 COLLATE latin1_swedish_ci';
+            }
+        }
+        push(@mysql_lc_commands,$createcmd);
     }
     push(@mysql_lc_commands,"USE loncapa");
     push(@mysql_lc_commands,qq{
@@ -2152,7 +2162,8 @@
     if ($usescreate) {
         @mysql_commands = ("CREATE USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
     } elsif ($usesauth) {
-        @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')");
+        @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')",
+                           "FLUSH PRIVILEGES");
         if ($is_mariadb) {
             push(@mysql_commands,"ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
         } else {




More information about the LON-CAPA-cvs mailing list