Make sure that PostgreSQL starts.
authorJason Stephenson <jason@sigio.com>
Tue, 4 Dec 2018 19:34:09 +0000 (14:34 -0500)
committerJason Stephenson <jason@sigio.com>
Tue, 4 Dec 2018 19:34:09 +0000 (14:34 -0500)
Modify scripts/postbuild.sh to write a check to start PostgreSQL if it
is not running in buildeg.sh.

Signed-off-by: Jason Stephenson <jason@sigio.com>
scripts/postbuild.sh

index a58f773..3785864 100755 (executable)
@@ -164,6 +164,9 @@ ejabberdctl register opensrf public.localhost password
 EOF_RUNASROOT
 
 # We need to do some postgresql work, and build the evergreen DB
+if [ -z "\$(pgrep -f postgres)" ]; then
+   sudo systemctl start postgresql
+fi
 sudo -u postgres psql -c "CREATE ROLE evergreen PASSWORD '$EGVMPGPASS' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
 cd /home/opensrf/Evergreen
 perl Open-ILS/src/support-scripts/eg_db_config --update-config \\