3bb84e0c93fe5e39aeb6384d1572afc2433e17bf
max
  Tue Sep 6 06:33:32 2022 -0700
fixing Gbic with certain combinations of mysql versions and underlying linux, refs #29847

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
index d508f01..45a4c91 100644
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -771,31 +771,31 @@
     
         # 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 
 
         # make sure that missing values in Mysql insert statements do not trigger errors, #18368: deactivate strict mode
         mysqlStrictModeOff
 
         # start mysql now
-        /sbin/service $MYSQLD start
+        startMysql
 
         secureMysql
         SET_MYSQL_ROOT=1
 
     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
@@ -1031,31 +1031,31 @@
         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
 
         mysqlStrictModeOff
-        service mariadb restart
+        startMysql
         # 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
@@ -1656,49 +1656,49 @@
 
 # stop the mysql database server, so we can write into its data directory
 function stopMysql
 {
     if [ -f /etc/init.d/mysql ]; then 
             service mysql stop
     elif [ -f /etc/init.d/mysqld ]; then 
             service mysqld stop
     elif [ -f /usr/lib/systemd/system/mariadb.service ]; then
             # RHEL 7, etc use systemd instead of SysV
             systemctl stop mariadb
     elif [ -f /usr/lib/systemd/system/mysql.service ]; then
             # at least seen in Fedora 17
             systemctl stop mysql
     else
-        echo2 Could not find mysql nor mysqld file in /etc/init.d. Please email genome-mirror@soe.ucsc.edu.
+        echo2 Could not find mysql nor mysqld file in /etc/init.d nor a systemd command. Please email genome-mirror@soe.ucsc.edu.
     fi
 }
 
 # start the mysql database server
 function startMysql
 {
     if [ -f /etc/init.d/mysql ]; then 
             service mysql start
     elif [ -f /etc/init.d/mysqld ]; then 
             service mysqld start
     elif [ -f /usr/lib/systemd/system/mariadb.service ]; then
             # RHEL 7, etc use systemd instead of SysV
             systemctl start mariadb
     elif [ -f /usr/lib/systemd/system/mysql.service ]; then
             # at least seen in Fedora 17
             systemctl start mysql
     else
-        echo2 Could not find mysql nor mysqld file in /etc/init.d. Please email genome-mirror@soe.ucsc.edu.
+        echo2 Could not find mysql nor mysqld file in /etc/init.d nor a systemd command. Please email genome-mirror@soe.ucsc.edu.
     fi
 }
 
 # only download a set of minimal mysql tables, to make a genome browser that is using the mysql failover mechanism
 # faster. This should be fast enough in the US West Coast area and maybe even on the East Coast.
 function downloadMinimal
 {
     DBS=$*
     if [ "$DBS" == "" ] ; then
         echo2 Argument error: the '"minimal"' command requires at least one assembly name, like hg19 or mm10.
         exit 100
     fi
 
     echo2
     echo2 Downloading minimal tables for databases $DBS