dfb3d71d8c2ad629c2c105049106268e2835ea75 max Wed Feb 23 08:52:14 2022 -0800 adapting browserSetup.sh for centos 8 stream, refs #28733 diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh index 0f33790..ba26e79 100755 --- src/product/installer/browserSetup.sh +++ src/product/installer/browserSetup.sh @@ -500,30 +500,33 @@ # wait for a key press function waitKey () { echo2 echo2 Press any key to continue or CTRL-C to abort. read -n 1 echo2 } # set MYCNF to the path to my.cnf function setMYCNF () { if [ -f /etc/my.cnf ] ; then # Centos 6-8 MYCNF=/etc/my.cnf + elif [ -f /etc/my.cnf.d/mariadb-server.cnf ] ; then + # Centos 8 stream + MYCNF=/etc/mysql/mysql.conf.d/mariadb-server.cnf elif [ -f /etc/mysql/my.cnf ] ; then # Ubuntu 14 MYCNF=/etc/mysql/my.cnf elif [ -f /etc/mysql/mysql.conf.d/mysqld.cnf ] ; then # Ubuntu 16, 18, 20 MYCNF=/etc/mysql/mysql.conf.d/mysqld.cnf else echo Could not find my.cnf. Adapt 'setMYCNF()' in browserSetup.sh and/or contact us. exit 1 fi echo Found Mariadb config file: $MYCNF } function mysqlAllowOldPasswords # mysql >= 8 does not allow the old passwords anymore. But our client is still compiled @@ -755,30 +758,34 @@ # Fedora 20 names the package mysql-server but it actually contains mariadb MYSQLD=mysqld MYSQLVER=`mysql --version` if [[ $MYSQLVER =~ "MariaDB" ]]; then MYSQLD=mariadb fi # start mysql on boot chkconfig --level 2345 $MYSQLD on # start mysql now /sbin/service $MYSQLD start secureMysql SET_MYSQL_ROOT=1 + + # make sure that missing values in Mysql insert statements do not trigger errors, #18368: deactivate strict mode + setMYCNF + sed -Ei '/^.(mysqld|server).$/a sql_mode=' $MYCNF else echo2 Mysql already installed fi # MySQL-python is required for hgGeneGraph # CentOS up to and including 7 default to python2, so MySQL-python is in the repos if yum list MySQL-python 2> /dev/null ; then yum -y install MySQL-python # Centos 8 defaults to python3 and it does not have a package MySQL-python anymore # So we install python2, the mysql libraries and fix up my_config.h manually # This is strange, but I was unable to find a different working solution. MariaDB simply does not have my_config.h else yum install -y python2 mysql-devel python2-devel wget gcc if [ -f /usr/include/mysql/my_config.h ]; then echo my_config.h found @@ -1008,33 +1015,33 @@ if [[ ! -f /usr/sbin/mysqld ]]; then echo2 echo2 Now installing the Mysql server. echo2 The root password will be set to a random string and will be written echo2 to the file /root/.my.cnf so root does not have to provide a password on echo2 the command line. waitKey moveAwayMyCnf # do not prompt in apt-get, will set an empty mysql root password export DEBIAN_FRONTEND=noninteractive # Debian / Ubuntu 20 defaults to Mysql 8 and Mysql 8 does not allow rsync of myisam anymore # -> we require mariaDb now # apt-get --assume-yes install mysql-server apt-get --assume-yes install mariadb-server - # make sure that missing values do not trigger errors, #18368 + # make sure that missing values do not trigger errors, #18368: deactivate strict mode setMYCNF - sed -i '/^.mysqld.$/a sql_mode=' $MYCNF + sed -Ei '/^.(mysqld|server).$/a' $MYCNF # flag so script will set mysql root password later to a random value SET_MYSQL_ROOT=1 fi } # download apache mysql libpng openssl into the current dir # and build them into $APACHEDIR/ext function buildApacheMysqlOpensslLibpng () { echo2 echo2 Now building cmake, openssl, pcre, apache and mysql into $APACHEDIR/ext echo2 This can take up to 20 minutes on slower machines waitKey # cmake - required by mysql