--- doc/install/linux/install.pl 2017/03/29 21:00:44 1.40 +++ doc/install/linux/install.pl 2018/06/19 11:35:12 1.44 @@ -27,6 +27,9 @@ use strict; use File::Copy; use Term::ReadKey; use DBI; +use Cwd(); +use File::Basename(); +use lib File::Basename::dirname(Cwd::abs_path($0)); use LCLocalization::localize; # ========================================================= The language handle @@ -72,7 +75,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.40 2017/03/29 21:00:44 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.44 2018/06/19 11:35:12 raeburn Exp $'."\n"; } # @@ -450,9 +453,6 @@ sub check_mysql_running { } } elsif ($distro =~ /^fedora(\d+)/) { if ($1 >= 16) { - if ($1 >= 19) { - $mysqldaemon ='mariadb'; - } $process = 'mysqld'; $proc_owner = 'mysql'; $use_systemctl = 1; @@ -470,6 +470,8 @@ sub check_mysql_running { } elsif ($distro =~ /^sles(\d+)/) { if ($1 >= 12) { $use_systemctl = 1; + $proc_owner = 'mysql'; + $process = 'mysqld'; } } elsif ($distro =~ /^suse(\d+)/) { if ($1 >= 13) { @@ -562,7 +564,15 @@ sub chkconfig { my $version = $1; @runlevels = qw/2 3 4 5/; @norunlevels = qw/0 1 6/; - $checker_bin = '/usr/sbin/sysv-rc-conf'; + if (($distro =~ /^ubuntu/) && ($version <= 16)) { + $checker_bin = '/usr/sbin/sysv-rc-conf'; + } else { + $uses_systemctl{'ntp'} = 1; + $uses_systemctl{'mysql'} = 1; + $uses_systemctl{'apache'} = 1; + $uses_systemctl{'memcached'} = 1; + $uses_systemctl{'cups'} = 1; + } $daemon{'mysql'} = 'mysql'; $daemon{'apache'} = 'apache2'; $daemon{'ntp'} = 'ntp'; @@ -1790,21 +1800,27 @@ CREATE TABLE IF NOT EXISTS metadata (tit sub setup_mysql_permissions { my ($dbh,$has_pass,@mysql_lc_commands) = @_; my ($mysqlversion,$mysqlsubver,$mysqlname) = &get_mysql_version(); - my ($usesauth,@mysql_commands); + my ($usesauth,$hasauthcol,@mysql_commands); if ($mysqlname =~ /^MariaDB/i) { if ($mysqlversion >= 10.2) { $usesauth = 1; + } elsif ($mysqlversion >= 5.5) { + $hasauthcol = 1; } } else { if (($mysqlversion > 5.7) || (($mysqlversion == 5.7) && ($mysqlsubver > 5))) { $usesauth = 1; + } elsif (($mysqlversion >= 5.6) || (($mysqlversion == 5.5) && ($mysqlsubver >= 7))) { + $hasauthcol = 1; } } if ($usesauth) { - @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject) VALUES('localhost','www','','','')", + @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')", "ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'"); + } elsif ($hasauthcol) { + @mysql_commands = ("INSERT user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www',password('localhostkey'),'','','','');"); } else { - @mysql_commands = ("INSERT user (Host, User, Password) VALUES('localhost','www',password('localhostkey'));"); + @mysql_commands = ("INSERT user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject) VALUES('localhost','www',password('localhostkey'),'','','');"); } if ($mysqlversion < 4) { push (@mysql_commands,"