add PG APT repo
authorChris Sharp <csharp@georgialibraries.org>
Thu, 14 Oct 2021 13:53:18 +0000 (09:53 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 14 Oct 2021 13:53:18 +0000 (09:53 -0400)
templates/setup-functions
templates/setup-head.sh
templates/setup.sh

index 02a1af3..ebd464a 100755 (executable)
@@ -72,43 +72,14 @@ if $APT_TOOL update
        gdebi --n libmarc-charset-perl*.deb
        gdebi --n libmarc-xml-perl*.deb
        gdebi --n libnet-z3950-simple2zoom-perl*.deb
-        echo                                                                                                                                 
-        echo "Installing Dependencies for Apache Web Sockets for web based staff client";sleep 2
+    echo                                                                                                                                 
        echo "installing ssl key and cert...";sleep 4                                    |
         tar zxvf $WD/$TARCHIVE -C /  etc/apache2/ssl/server.crt etc/apache2/ssl/server.key
-       gdebi --n libapache2-mod-websocket*.deb
        echo
-       ### Configure Apache2 Web Sockets.
-       echo "Setting up Apache Web Sockets for opensrf";sleep 2
-       service apache2 stop;sleep 2
-       sh /usr/share/doc/apache2/examples/setup-instance websockets
-       if [ -e "$WD/websockets" ]
-       then
-               echo
-               echo "Websockets found copying config files..."
-               sleep 2
-               # mkdir -p /etc/apache2/apache2-websockets
-               # cp -f $WD/websockets/* /etc/apache2-websockets
-#              cat <<EOF >> /etc/apache2-websockets/envvars
-
-               ### For Opensrf
-#              export OSRF_WEBSOCKET_IDLE_TIMEOUT=120
-#              export OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL=5
-#              export OSRF_WEBSOCKET_CONFIG_FILE=/openils/conf/opensrf_core.xml
-#              export OSRF_WEBSOCKET_CONFIG_CTXT=gateway
-#              export OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME=600
-#EOF
-       fi
-       a2dismod websocket
-       update-rc.d apache2-websockets defaults
-
-       echo 
        echo "Installing OpenSRF:";sleep 2
        tar zxvf $WD/$TARCHIVE -C /  etc/sudoers.d/opensrf
        gdebi --n opensrf*.deb
 
-       service apache2-websockets start
-       
        echo
        echo "Installing Evergreen ILS:";sleep 2
        gdebi --n evergreen-ils*.deb
@@ -200,11 +171,7 @@ fi
 ## Munin on monitor servers.
 if [ -e "$WD/Munin/munin-cron.crontab" ] ### This file only should exist on a monitoring server.
 then
-       if crontab -u munin "$WD/Munin/munin-cron.crontab"
-       then
-               sleep 2
-               echo "Running munin-cron manually for first time."
-               echo "This may take a while the first time..."
+       if crontab -u munin "$WD/Munin/munin-cron.crontab" then sleep 2 echo "Running munin-cron manually for first time." echo "This may take a while the first time..."
                sudo su -c munin-cron --shell=/bin/bash munin
        else    
                echo "Failed to install crontab for munin.  Not running"
@@ -223,6 +190,11 @@ then
 fi
 }
 
+Add_PG_APT_Repo () {
+wget https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
+sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+}
+
 
 Check_Netplan () { ### Check if we are using netplan 
 OS_VER="$(lsb_release -sr | awk -F"." '{ print $1 }')"
index 8dd2545..7504ba9 100755 (executable)
@@ -134,6 +134,7 @@ sed -i 's/^search.*/search CLUSTER_DOMAINNAME/g' /etc/resolv.conf
 ### Install dependencies.
 if [ -e head_file_apt.list ]
         then
+        Add_PG_APT_Repo
         $APT_TOOL update && $APT_TOOL -y install  $(cat head_file_apt.list)
 fi
 
index db0b191..969b0d8 100755 (executable)
@@ -216,6 +216,7 @@ if [ -e tar_file_apt.list ]
                        --shell /bin/bash --group --gecos "PostgreSQL administrator" --uid "$PG_UID" postgres
        fi
     fi
+    Add_PG_APT_Repo
     $APT_TOOL update 2>&1 | tee -a $INSTALL_LOG
     $APT_TOOL -y install $(cat tar_file_apt.list) 2>&1 | tee -a "$INSTALL_LOG"
 fi
@@ -371,6 +372,10 @@ else ### setup logging services on this host.
 fi
 }
 
+Add_PG_APT_Repo () {
+wget sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+}
 
 ### Setup DB #and repoter
 DBInstallErr () { ### DB install error.
@@ -388,6 +393,7 @@ then
        sleep 2
        if [ "$PKG_SET" = "0" ] 
        then
+            Add_PG_APT_Repo
            $APT_TOOL update
            $APT_TOOL -yq install postgresql-${PG_VER} postgresql-contrib-${PG_VER} postgresql-plperl-${PG_VER} postgresql-server-dev-${PG_VER} || DBInstallErr 
        else