version 1.24, 2024/06/28 12:46:47
|
version 1.26, 2024/07/09 14:18:16
|
Line 49 Linux distro/version being used. The fi
|
Line 49 Linux distro/version being used. The fi
|
/etc/sysconfig/rhn/sources (for RHEL4), or /etc/yum.repos.d/loncapa.repo |
/etc/sysconfig/rhn/sources (for RHEL4), or /etc/yum.repos.d/loncapa.repo |
(for Fedora >= 21; Oracle Linux; AlmaLinux; RockyLinux; CentOS/RHEL >= 8). |
(for Fedora >= 21; Oracle Linux; AlmaLinux; RockyLinux; CentOS/RHEL >= 8). |
|
|
|
The script also modifies /home/www/.inputrc on Linux distros which have |
|
readline 8.1 or newer, i.e., CentOS/Scientific Linux/RHEL >= 9, |
|
Ubuntu >= 22, Debian >= 12, and Fedora >= 34. |
|
|
=head1 DESCRIPTION |
=head1 DESCRIPTION |
|
|
This script will modify /etc/my.cnf, /etc/mysql/my.cnf, |
This script will modify /etc/my.cnf, /etc/mysql/my.cnf, |
Line 56 This script will modify /etc/my.cnf, /et
|
Line 60 This script will modify /etc/my.cnf, /et
|
/etc/mysql/mariadb.conf.d/50-server.cnf, |
/etc/mysql/mariadb.conf.d/50-server.cnf, |
and /etc/yum.conf, /etc/yum.repos.d/loncapa.repo, |
and /etc/yum.conf, /etc/yum.repos.d/loncapa.repo, |
/etc/apt/sources.list, /etc/apt/sources.list.d/loncapa.list or |
/etc/apt/sources.list, /etc/apt/sources.list.d/loncapa.list or |
/etc/sysconfig/rhn/sources to ensure certain parameters are set properly. |
/etc/sysconfig/rhn/sources and /home/www/.inputrc to ensure |
|
certain parameters are set properly. |
|
|
The LON-CAPA yum repositories are added to /etc/yum.conf, |
The LON-CAPA yum repositories are added to /etc/yum.conf, |
/etc/yum.repos.d/loncapa.repo, or /etc/sysconfig/rhn/sources |
/etc/yum.repos.d/loncapa.repo, or /etc/sysconfig/rhn/sources |
Line 359 my $mysql_www_status =
|
Line 364 my $mysql_www_status =
|
key =>'password=', |
key =>'password=', |
value =>$loncapa_config->{'lonSqlAccess'}},]); |
value =>$loncapa_config->{'lonSqlAccess'}},]); |
|
|
|
my $needs_inputrc_check; |
|
if ($dist =~ /^debian(\d+)$/) { |
|
if ($1 >= 12) { |
|
$needs_inputrc_check = 1; |
|
} |
|
} elsif ($dist =~ /^ubuntu(\d+)$/) { |
|
if ($1 >= 22) { |
|
$needs_inputrc_check = 1; |
|
} |
|
} elsif ($dist =~ /^(?:redhat|oracle|alma|rocky|centos-stream)(\d+)$/) { |
|
if ($1 >= 9) { |
|
$needs_inputrc_check = 1; |
|
} |
|
} elsif ($dist =~ /^fedora(\d+)$/) { |
|
if ($1 >= 34) { |
|
$needs_inputrc_check = 1; |
|
} |
|
} |
|
|
|
if ($needs_inputrc_check) { |
|
my $bash_www_cnf = '/home/www/.inputrc'; |
|
if (!-e $bash_www_cnf) { |
|
system("touch $bash_www_cnf"); |
|
if (open(my $fh,'>',$bash_www_cnf)) { |
|
print $fh "set enable-bracketed-paste off\n"; |
|
close($fh); |
|
} else { |
|
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
|
} |
|
my $wwwuid = getpwnam('www'); |
|
my $wwwgid = getgrnam('www'); |
|
if ($wwwuid!=$<) { |
|
chown($wwwuid,$wwwgid,$bash_www_cnf); |
|
} |
|
} else { |
|
my ($bracketed_paste_on,$bracketed_paste_off,@preserve); |
|
if (open(my $fh,'<',$bash_www_cnf)) { |
|
while (my $line=<$fh>) { |
|
chomp($line); |
|
if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { |
|
if ($1 eq 'off') { |
|
$bracketed_paste_off = 1; |
|
} else { |
|
$bracketed_paste_on = 1; |
|
} |
|
} else { |
|
push(@preserve,$line); |
|
} |
|
} |
|
close($fh); |
|
} |
|
if ($bracketed_paste_on || !$bracketed_paste_off) { |
|
if (open(my $fh,'>',$bash_www_cnf)) { |
|
print $fh "set enable-bracketed-paste off\n"; |
|
if (@preserve) { |
|
foreach my $entry (@preserve) { |
|
print $fh "$entry\n"; |
|
} |
|
} |
|
close($fh); |
|
} else { |
|
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
|
} |
|
} |
|
} |
|
} |
|
|
my $exitvalue = 0; |
my $exitvalue = 0; |
|
|
if ($mysql_global_status) { $exitvalue = 1; } |
if ($mysql_global_status) { $exitvalue = 1; } |