#!/bin/bash # Script to fix the race condition error that doesn't allow the creation of a new user after SG install. ## Stop the StrataGuard service. service stillsecure stop ## Reset postgresql trust model to "trust". sed -e 's/md5/trust/g' /var/lib/pgsql/data/pg_hba.conf > /var/lib/pgsql/data/pg_hba.conf.tmp cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.orig mv /var/lib/pgsql/data/pg_hba.conf.tmp /var/lib/pgsql/data/pg_hba.conf chown postgres:postgres /var/lib/pgsql/data/pg_hba.conf chmod 600 /var/lib/pgsql/data/pg_hba.conf ## Restart the sql server for root access service postgresql start ## Get the database password that was used on install. PGPASSWORD=`grep CACD.DB.Pass /usr/local/stillsecure/properties/stillsecure.properties | sed 's/.*=//;'` ## Put desired DB password (plaintext) into /etc/sysconfig/dbPass. touch /etc/sysconfig/dbPass echo $PGPASSWORD > /etc/sysconfig/dbPass ## Remove /etc/sysconfig/pgsetup. rm /etc/sysconfig/pgsetup ## If the postgresql service is running when setupdb.sh is run the script errors out. service postgresql stop ## Rerun /etc/init.d/setupdb.sh /etc/init.d/setupdb.sh start ## Restart the StrataGuard services service stillsecure restart