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

raeburn raeburn at source.lon-capa.org
Wed Jun 12 21:21:59 EDT 2024


raeburn		Thu Jun 13 01:21:59 2024 EDT

  Modified files:              
    /doc/install/linux	install.pl 
  Log:
  - Support debian 12 (bookworm)
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.88 doc/install/linux/install.pl:1.89
--- doc/install/linux/install.pl:1.88	Wed Jun 12 23:35:04 2024
+++ doc/install/linux/install.pl	Thu Jun 13 01:21:59 2024
@@ -78,7 +78,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.88 2024/06/12 23:35:04 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.89 2024/06/13 01:21:59 raeburn Exp $'."\n";
 }
 
 #
@@ -572,7 +572,7 @@
         if ($mysqlsetup eq 'needsrestart') {
             $mysqlrestart = '';
             if ($distro eq 'ubuntu') {
-                $mysqlrestart = 'sudo '; 
+                $mysqlrestart = 'sudo ';
             }
             $mysqlrestart .= 'service mysql restart';
             return ($distro,$gotprereqs,$localecmd,$packagecmd,$updatecmd,$installnow,$mysqlrestart);
@@ -622,6 +622,12 @@
             $process = 'mysqld';
             $proc_owner = 'mysql';
         }
+    } elsif ($distro =~ /^debian(\w+)/) {
+        if ($1 >= 12) {
+            $process = 'mysql';
+            $proc_owner = 'mysql';
+            $mysqldaemon = 'mariadb';
+        }
     } elsif ($distro =~ /^fedora(\d+)/) {
         if ($1 >= 16) {
             $process = 'mysqld';
@@ -764,9 +770,13 @@
         if (($distro =~ /^ubuntu/) && ($version <= 8)) {
             $daemon{'cups'} = 'cupsys';
         }
-        if (($distro =~ /^ubuntu/) && ($version >= 18)) {
+        if ((($distro =~ /^ubuntu/) && ($version >= 18)) ||
+            (($distro  =~ /^debian/) && ($version >= 12))) {
             $daemon{'ntp'}    = 'chrony';
         }
+        if (($distro  =~ /^debian/) && ($version >= 12)) {
+            $daemon{'mysql'} = 'mariadb';
+        }
     } elsif ($distro =~ /^fedora(\d+)/) {
         my $version = $1;
         if ($version >= 15) {
@@ -992,7 +1002,8 @@
         my $distname = $1;
         my $version = $2;
         my ($stdconf,$stdsite);
-        if (($distname eq 'ubuntu') && ($version > 12)) {
+        if ((($distname eq 'ubuntu') && ($version > 12)) ||
+            (($distname eq 'debian') && ($version >= 12))) {
             $stdconf = "$instdir/debian-ubuntu/ubuntu14/loncapa_conf";
             $stdsite = "$instdir/debian-ubuntu/ubuntu14/loncapa_sites";
         } else {
@@ -1003,7 +1014,8 @@
             print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; 
         } else {
             my ($configfile,$sitefile);
-            if (($distname eq 'ubuntu') && ($version > 12)) {
+            if ((($distname eq 'ubuntu') && ($version > 12)) ||
+                (($distname eq 'debian') && ($version >= 12))) {
                 $sitefile = '/etc/apache2/sites-available/loncapa.conf';
                 $configfile = '/etc/apache2/conf-available/loncapa.conf';
             } else {
@@ -1019,7 +1031,8 @@
                     }
                 }
             }
-            if ((!$fixapache) && ($distname eq 'ubuntu') && ($version > 12)) {
+            if ((!$fixapache) && ((($distname eq 'ubuntu') && ($version > 12)) ||
+                                  (($distname eq 'debian') && ($version >= 12))))  {
                 if (($sitefile ne '') && (-e $sitefile) && (-e $stdsite)) {
                     if (open(PIPE, "diff --brief $stdsite $sitefile |")) {
                         my $diffres = <PIPE>;
@@ -1039,7 +1052,7 @@
                 }
             }
         }
-        if ((!$fixapache) && ($distname eq 'ubuntu')) {
+        if ((!$fixapache) && (($distname eq 'ubuntu') || ($distname eq 'debian'))) {
             my $sitestatus = "/etc/apache2/mods-available/status.conf";
             my $stdstatus = "$instdir/debian-ubuntu/status.conf";
             if ((-e $stdstatus) && (-e $sitestatus)) {
@@ -1390,7 +1403,11 @@
                             foreach my $file (sort(keys(%{$sslfiles{$key}}))) {
                                 unless ((-l "$enabled_dir/$file") &&
                                         (readlink("$enabled_dir/$file") eq "$ssldir/$file")) {
-                                    print_and_log(&mt("Warning, use: 'sudo a2ensite $file' to activate LON-CAPA SSL Apache config\n"));
+                                    if ($distro =~ /^debian(\d+)$/) {
+                                        print_and_log(&mt("Warning, use: 'a2ensite $file' to activate LON-CAPA SSL Apache config\n"));
+                                    } elsif ($distro =~ /^ubuntu(\d+)$/) {
+                                        print_and_log(&mt("Warning, use: 'sudo a2ensite $file' to activate LON-CAPA SSL Apache config\n"));
+                                    }
                                 }
                             }
                         }
@@ -2349,6 +2366,10 @@
             $lc_uses_systemctl = 1;
         }
         $uses_sudo = 1;
+    } elsif ($distro =~ /^debian(\d+)$/) {
+        if ($1 >= 12) {
+            $lc_uses_systemctl = 1;
+        }
     } elsif ($distro =~ /^sles(\d+)$/) {
         if ($1 > 12) {
             $lc_uses_systemctl = 1;
@@ -2583,7 +2604,8 @@
 	            &print_and_log(&mt('Removing [_1] from startup.',$service)."\n");
                     if ($distro =~ /^(?:debian|ubuntu)(\d+)/) {
                         my $version = $1;
-                        if (($distro =~ /^ubuntu/) && ($version > 16)) {
+                        if ((($distro =~ /^ubuntu/) && ($version > 16)) ||
+                            (($distro =~ /^debian/) && ($version >= 12))) {
                             if (ref($uses_systemctl) eq 'HASH') {
                                 if ($uses_systemctl->{$service}) {
                                     if (`systemctl is-enabled $service`) {
@@ -3374,11 +3396,13 @@
         $distname = $1;
         $version = $2;
     }
-    if (($distname eq 'ubuntu') && ($version > 12)) {
+    if ((($distname eq 'ubuntu') && ($version > 12)) ||
+        (($distname eq 'debian') && ($version >= 12))) {
         $defaultconfig = "$apache2_sites_enabled_dir/000-default.conf";
     }
     my ($skipconf,$skipsite,$skipstatus);
-    if (($distname eq 'ubuntu') && ($version > 12)) {
+    if ((($distname eq 'ubuntu') && ($version > 12)) ||
+        (($distname eq 'debian') && ($version >= 12))) {
         my $apache2_conf_enabled_dir = '/etc/apache2/conf-enabled';
         my $apache2_conf_available_dir = '/etc/apache2/conf-available';
         my $defaultconf = $apache2_conf_enabled_dir.'/loncapa.conf';
@@ -3531,7 +3555,7 @@
             }
         }
     }
-    if ($distname eq 'ubuntu') {
+    if (($distname eq 'ubuntu') || ($distname eq 'debian')) {
         my $sitestatus = "$apache2_mods_available_dir/status.conf";
         my $stdstatus = "$instdir/debian-ubuntu/status.conf";
         if ((-e $sitestatus) && (-e $stdstatus)) {




More information about the LON-CAPA-cvs mailing list