version 1.19, 2021/03/22 21:15:53
|
version 1.21, 2021/12/20 03:13:29
|
Line 113 if ($dist =~ /^fedora(\d+)$/) {
|
Line 113 if ($dist =~ /^fedora(\d+)$/) {
|
key => 'gpgkey=', |
key => 'gpgkey=', |
value => $gpg, |
value => $gpg, |
}],$nobackup); |
}],$nobackup); |
} elsif ($dist =~ /^(rhes|centos|scientific|oracle)(\d+)$/) { |
} elsif ($dist =~ /^(rhes|centos|scientific|oracle|rocky|alma)(\d+)$/) { |
my $type = $1; |
my $type = $1; |
my $ver = $2; |
my $ver = $2; |
my $longver = $ver; |
my $longver = $ver; |
Line 150 if ($dist =~ /^fedora(\d+)$/) {
|
Line 150 if ($dist =~ /^fedora(\d+)$/) {
|
gpg => 'versions/oracle/RPM-GPG-KEY-loncapa', |
gpg => 'versions/oracle/RPM-GPG-KEY-loncapa', |
gpgchk => 1, |
gpgchk => 1, |
}, |
}, |
|
rocky => { |
|
title => 'Rocky Linux', |
|
path => 'rocky/loncapa', |
|
gpg => 'versions/rocky/RPM-GPG-KEY-loncapa', |
|
gpgchk => 1, |
|
}, |
|
alma => { |
|
title => 'AlmaLinux', |
|
path => 'alma/loncapa', |
|
gpg => 'versions/alma/RPM-GPG-KEY-loncapa', |
|
gpgchk => 1, |
|
}, |
); |
); |
if (ref($info{$type}) eq 'HASH') { |
if (ref($info{$type}) eq 'HASH') { |
if ($ver > 4) { |
if ($ver > 4) { |
my $file = '/etc/yum.conf'; |
my $file = '/etc/yum.conf'; |
if (($ver > 7) || ($type eq 'oracle')) { |
if (($ver > 7) || ($type eq 'oracle') || ($type eq 'rocky') || ($type eq 'alma')) { |
$file = '/etc/yum.repos.d/loncapa.repo'; |
$file = '/etc/yum.repos.d/loncapa.repo'; |
$nobackup = 1; |
$nobackup = 1; |
} |
} |
Line 245 if ($dist =~ /^fedora(\d+)$/) {
|
Line 257 if ($dist =~ /^fedora(\d+)$/) {
|
} |
} |
|
|
my $mysqlfile = '/etc/my.cnf'; |
my $mysqlfile = '/etc/my.cnf'; |
|
my $mysqlconf = [{section =>'mysqld', |
|
key =>'wait_timeout=', |
|
value =>'31536000'}]; |
if ($dist =~ /^ubuntu(\d+)$/) { |
if ($dist =~ /^ubuntu(\d+)$/) { |
my $version = $1; |
my $version = $1; |
$mysqlfile = '/etc/mysql/my.cnf'; |
$mysqlfile = '/etc/mysql/my.cnf'; |
if ($version > 14) { |
if ($version > 14) { |
$mysqlfile = '/etc/mysql/mysql.conf.d/mysqld.cnf'; |
$mysqlfile = '/etc/mysql/mysql.conf.d/mysqld.cnf'; |
|
if ($version < 20) { |
|
push(@{$mysqlconf}, |
|
{section =>'mysqld', |
|
key =>'sql_mode=', |
|
value =>'"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'}); |
|
} else { |
|
push(@{$mysqlconf}, |
|
{section =>'mysqld', |
|
key =>'sql_mode=', |
|
value =>'"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"'}); |
|
} |
} |
} |
} |
} |
|
|
my $mysql_global_status = |
my $mysql_global_status = &update_file($mysqlfile,$mysqlconf); |
&update_file($mysqlfile, |
|
[{section =>'mysqld', |
|
key =>'wait_timeout=', |
|
value =>'31536000', }]); |
|
|
|
my $local_my_cnf = '/home/www/.my.cnf'; |
my $local_my_cnf = '/home/www/.my.cnf'; |
if (! -e $local_my_cnf) { |
if (! -e $local_my_cnf) { |