850ee002a1ce7707a2e86f9b3a1f534d514f6cd8
max
  Wed Mar 31 02:25:29 2021 -0700
updating blat servers table in gbic, refs #27301

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
index 4d9eff1..889dfbd 100755
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -1146,33 +1146,32 @@
 
 # setup the mysql databases for the genome browser and grant 
 # user access rights
 function mysqlDbSetup ()
 {
     # -------------------
     # Mysql db setup
     # -------------------
     echo2
     echo2 Creating Mysql databases customTrash, hgTemp and hgcentral
     waitKey
     $MYSQL -e 'CREATE DATABASE IF NOT EXISTS customTrash;'
     $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hgcentral;'
     $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hgTemp;'
     $MYSQL -e 'CREATE DATABASE IF NOT EXISTS hgFixed;' # empty db needed for gencode tracks
-    downloadFile http://$HGDOWNLOAD/admin/hgcentral.sql | $MYSQL hgcentral
-    # the blat servers don't have fully qualified dom names in the download data
-    $MYSQL hgcentral -e 'UPDATE blatServers SET host=CONCAT(host,".soe.ucsc.edu");'
+
+    updateBlatServers
     
     echo2
     echo2 "Will now grant permissions to browser database access users:"
     echo2 "User: 'browser', password: 'genome' - full database access permissions"
     echo2 "User: 'readonly', password: 'access' - read only access for CGI binaries"
     echo2 "User: 'readwrite', password: 'update' - readwrite access for hgcentral DB"
     waitKey
     
     #  Full access to all databases for the user 'browser'
     #       This would be for browser developers that need read/write access
     #       to all database tables.  
     $MYSQL -e "CREATE USER browser@localhost IDENTIFIED BY 'genome';"
     $MYSQL -e "GRANT SELECT, INSERT, UPDATE, DELETE, FILE, "\
 "CREATE, DROP, ALTER, CREATE TEMPORARY TABLES on *.* TO browser@localhost; "
     
@@ -1617,30 +1616,38 @@
       echo2 'Downloading download-tool udr (UDP-based rsync with multiple streams) to /usr/local/bin/udr'
       waitKey
       downloadFile $UDRURL > /usr/local/bin/udr
       chmod a+x /usr/local/bin/udr
     fi
 }
 
 function cleanTrash () 
 {
     echo2 Removing files older than one day in $TRASHDIR, not running on $TRASHDIR/ct
     # -L = follow symlinks
     # -atime +1 = files older than one day
     find -L $TRASHDIR -not -path $TRASHDIR/ct/\* -and -type f -atime +1 -exec rm -f {} \;
 }
 
+function updateBlatServers ()
+{
+   echo2 Creating or updating the BLAT servers table
+   downloadFile http://$HGDOWNLOAD/admin/hgcentral.sql | $MYSQL hgcentral
+   # the blat servers don't have fully qualified dom names in the download data
+   $MYSQL hgcentral -e 'UPDATE blatServers SET host=CONCAT(host,".soe.ucsc.edu");'
+}
+
 function cgiUpdate ()
 {
    # update the CGIs
    $RSYNC -avzP --exclude=RNAplot --exclude=hg.conf --exclude=hg.conf.local --exclude=RNAplot $HGDOWNLOAD::cgi-bin/ $APACHEDIR/cgi-bin/ 
    # update the html docs
    echo2 Updating Apache htdocs
    $RSYNC -avzP --exclude=*.{bb,bam,bai,bw,gz,2bit,bed} --exclude=ENCODE --exclude=trash $HGDOWNLOAD::htdocs/ $APACHEDIR/htdocs/ 
    # assign all downloaded files to a valid user. 
    chown -R $APACHEUSER:$APACHEUSER $APACHEDIR/*
 }
 
 function updateBrowser {
    cgiUpdate
    echo
 
@@ -1654,30 +1661,32 @@
    echo updating GBDB: $DBS
    for db in $DBS; do 
        echo2 syncing gbdb: $db
        rsync -avp $RSYNCOPTS $HGDOWNLOAD::gbdb/$db/ $GBDBDIR/$db/ 
    done
 
    # update the mysql DBs
    stopMysql
    DBS=`ls /var/lib/mysql/ | egrep -v '(Trash$)|(hgTemp)|(^ib_)|(^ibdata)|(^aria)|(^mysql)|(performance)|(.flag$)|(hgcentral)'`
    for db in $DBS; do 
        echo2 syncing full mysql database: $db
        $RSYNC --update --progress -avp $RSYNCOPTS $HGDOWNLOAD::mysql/$db/ $MYSQLDIR/$db/
    done
    startMysql
 
+   updateBlatServers
+    
    echo2 update finished
 }
 
 function addTools {
    rsync -avP hgdownload.soe.ucsc.edu::genome/admin/exe/linux.x86_64/ /usr/local/bin/
    echo2 The UCSC User Tools were copied to /usr/local/bin
    echo2 Please note that most of the tools require an .hg.conf file in the users
    echo2 home directory. A very minimal .hg.conf file can be found here:
    echo2 "http://genome-source.soe.ucsc.edu/gitlist/kent.git/blob/master/src/product/minimal.hg.conf"
 }
 
 # ------------ end of utility functions ----------------
 
 # -- START OF SCRIPT  --- MAIN ---