[LON-CAPA-cvs] cvs: doc /install/linux install.pl
raeburn
raeburn at source.lon-capa.org
Wed Jun 20 08:12:40 EDT 2018
raeburn Wed Jun 20 12:12:40 2018 EDT
Modified files:
/doc/install/linux install.pl
Log:
- Support Ubuntu 18 LTS
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.44 doc/install/linux/install.pl:1.45
--- doc/install/linux/install.pl:1.44 Tue Jun 19 11:35:12 2018
+++ doc/install/linux/install.pl Wed Jun 20 12:12:39 2018
@@ -75,7 +75,7 @@
&mt('Stopping execution.')."\n";
exit;
} else {
- print LOG '$Id: install.pl,v 1.44 2018/06/19 11:35:12 raeburn Exp $'."\n";
+ print LOG '$Id: install.pl,v 1.45 2018/06/20 12:12:39 raeburn Exp $'."\n";
}
#
@@ -1530,7 +1530,7 @@
}
if ($callsub{'stopsrvcs'}) {
- &kill_extra_services($distro,$recommended->{'stopsrvcs'});
+ &kill_extra_services($distro,$recommended->{'stopsrvcs'},$uses_systemctl);
} else {
&print_and_log(&mt('Skipping stopping unnecessary service ([_1] daemons).',"'cups','memcached'")."\n");
}
@@ -1717,7 +1717,7 @@
}
sub kill_extra_services {
- my ($distro,$stopsrvcs) = @_;
+ my ($distro,$stopsrvcs,$uses_systemctl) = @_;
if (ref($stopsrvcs) eq 'HASH') {
my @stopping = sort(keys(%{$stopsrvcs}));
if (@stopping) {
@@ -1748,8 +1748,19 @@
}
}
&print_and_log(&mt('Removing [_1] from startup.',$service)."\n");
- if ($distro =~ /^(debian|ubuntu)/) {
- &print_and_log(`update-rc.d -f $daemon remove`);
+ if ($distro =~ /^(?:debian|ubuntu)(\d+)/) {
+ my $version = $1;
+ if (($distro =~ /^ubuntu/) && ($version > 16)) {
+ if (ref($uses_systemctl) eq 'HASH') {
+ if ($uses_systemctl->{$service}) {
+ if (`systemctl is-enabled $service`) {
+ &print_and_log(`systemctl disable $service`);
+ }
+ }
+ }
+ } else {
+ &print_and_log(`update-rc.d -f $daemon remove`);
+ }
} else {
if (ref($uses_systemctl) eq 'HASH') {
if ($uses_systemctl->{$service}) {
@@ -1816,7 +1827,7 @@
}
if ($usesauth) {
@mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')",
- "ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
+ "ALTER USER 'www'\@'localhost' IDENTIFIED WITH mysql_native_password 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 {
@@ -1871,7 +1882,7 @@
}
}
if ($got_passwd) {
- my (@newpass_cmds) = &new_mysql_rootpasswd($newmysqlpass);
+ my (@newpass_cmds) = &new_mysql_rootpasswd($newmysqlpass,$usesauth);
push(@mysql_commands, at newpass_cmds);
} else {
print_and_log(&mt('Failed to get MySQL root password from user input.')."\n");
@@ -1880,7 +1891,6 @@
if (@mysql_commands) {
foreach my $cmd (@mysql_commands) {
$dbh->do($cmd) || print $dbh->errstr."\n";
-
}
}
if (@mysql_lc_commands) {
@@ -1904,7 +1914,7 @@
sub new_mysql_rootpasswd {
my ($currmysqlpass,$usesauth) = @_;
if ($usesauth) {
- return ("ALTER USER 'root'\@'localhost' IDENTIFIED BY '$currmysqlpass'",
+ return ("ALTER USER 'root'\@'localhost' IDENTIFIED WITH mysql_native_password BY '$currmysqlpass'",
"FLUSH PRIVILEGES;");
} else {
return ("SET PASSWORD FOR 'root'\@'localhost'=PASSWORD('$currmysqlpass')",
More information about the LON-CAPA-cvs
mailing list