From 849e75caefd601d50f6499886687ba8733927227 Mon Sep 17 00:00:00 2001 From: mjames-upc Date: Mon, 9 Jul 2018 14:58:15 -0600 Subject: [PATCH] awipsadmin->awips --- .../db/ddl/climate/createAdditionalTables.sql | 8 +++---- .../opt/db/ddl/climate/createClimateDb.sql | 4 ++-- .../opt/db/ddl/damcat/createDamcat.sql | 4 ++-- .../build.edex/opt/db/ddl/hmdb/createHMDB.sql | 4 ++-- .../opt/db/ddl/maps/createMapsDb.sql | 8 +++---- .../opt/db/ddl/maps/createMapsDbSnapshot.sh | 2 +- .../opt/db/ddl/maps/importGeoJSONFile.sh | 4 ++-- .../opt/db/ddl/maps/importMarkersInfo.sh | 2 +- .../opt/db/ddl/maps/importPointsInfo.sh | 2 +- .../opt/db/ddl/maps/importShapeFile.sh | 2 +- .../opt/db/ddl/maps/initializeMapsDb.sh | 2 +- .../opt/db/ddl/ncep/createNcepDb.sql | 4 ++-- .../alter_database_roles_and_permissions.sh | 2 +- .../opt/db/ddl/setup/initial_setup_server.sql | 18 +++++++-------- .../opt/db/replication/replication-config.sh | 2 +- .../opt/db/replication/setup-standby.sh | 2 +- .../opt/tools/gen-simple-db-creds.sh | 2 +- .../climate.hibernate.admin.cfg.xml | 2 +- .../damCatalog.hibernate.admin.cfg.xml | 2 +- .../fxa.hibernate.admin.cfg.xml | 2 +- .../hmdb.hibernate.admin.cfg.xml | 2 +- .../ihfs.hibernate.admin.cfg.xml | 2 +- .../maps.hibernate.admin.cfg.xml | 2 +- .../metadata.hibernate.admin.cfg.xml | 2 +- .../ncep.hibernate.admin.cfg.xml | 2 +- .../Installer.database/component.spec | 6 ++--- .../Installer.localization/component.spec | 4 ++-- .../Installer.maps-database/component.spec | 22 +++++++++---------- .../Installer.ncep-database/component.spec | 21 +++++++++--------- 29 files changed, 70 insertions(+), 71 deletions(-) diff --git a/edexOsgi/build.edex/opt/db/ddl/climate/createAdditionalTables.sql b/edexOsgi/build.edex/opt/db/ddl/climate/createAdditionalTables.sql index 1c3f138f70..63db98970f 100644 --- a/edexOsgi/build.edex/opt/db/ddl/climate/createAdditionalTables.sql +++ b/edexOsgi/build.edex/opt/db/ddl/climate/createAdditionalTables.sql @@ -26,8 +26,8 @@ WITH ( OIDS=FALSE ); ALTER TABLE cpg_session - OWNER TO awipsadmin; -GRANT ALL ON TABLE cpg_session TO awipsadmin; + OWNER TO awips; +GRANT ALL ON TABLE cpg_session TO awips; GRANT SELECT, UPDATE, INSERT, TRUNCATE, DELETE, TRIGGER ON TABLE cpg_session TO awips; GRANT SELECT, UPDATE, INSERT, TRUNCATE, DELETE, TRIGGER ON TABLE cpg_session TO pguser; @@ -46,7 +46,7 @@ WITH ( OIDS=FALSE ); ALTER TABLE sent_prod_record - OWNER TO awipsadmin; -GRANT ALL ON TABLE sent_prod_record TO awipsadmin; + OWNER TO awips; +GRANT ALL ON TABLE sent_prod_record TO awips; GRANT SELECT, UPDATE, INSERT, TRUNCATE, DELETE, TRIGGER ON TABLE sent_prod_record TO awips; GRANT SELECT, UPDATE, INSERT, TRUNCATE, DELETE, TRIGGER ON TABLE sent_prod_record TO pguser; \ No newline at end of file diff --git a/edexOsgi/build.edex/opt/db/ddl/climate/createClimateDb.sql b/edexOsgi/build.edex/opt/db/ddl/climate/createClimateDb.sql index 0f9fe98b88..23ff62c6be 100644 --- a/edexOsgi/build.edex/opt/db/ddl/climate/createClimateDb.sql +++ b/edexOsgi/build.edex/opt/db/ddl/climate/createClimateDb.sql @@ -5,6 +5,6 @@ * */ \set ON_ERROR_STOP 1 -CREATE TABLESPACE climate OWNER awipsadmin LOCATION '%{tablespace_dir}%/climate'; +CREATE TABLESPACE climate OWNER awips LOCATION '%{tablespace_dir}%/climate'; COMMENT ON TABLESPACE climate IS 'Climate Database tablespace'; -CREATE DATABASE climate OWNER awipsadmin TABLESPACE climate; \ No newline at end of file +CREATE DATABASE climate OWNER awips TABLESPACE climate; \ No newline at end of file diff --git a/edexOsgi/build.edex/opt/db/ddl/damcat/createDamcat.sql b/edexOsgi/build.edex/opt/db/ddl/damcat/createDamcat.sql index 60bce7b384..b92920eaf0 100644 --- a/edexOsgi/build.edex/opt/db/ddl/damcat/createDamcat.sql +++ b/edexOsgi/build.edex/opt/db/ddl/damcat/createDamcat.sql @@ -20,6 +20,6 @@ \set ON_ERROR_STOP 1 DROP DATABASE IF EXISTS dc_ob7oax; DROP TABLESPACE IF EXISTS damcat; -CREATE TABLESPACE damcat OWNER awipsadmin LOCATION '%{tablespace_dir}%/damcat'; +CREATE TABLESPACE damcat OWNER awips LOCATION '%{tablespace_dir}%/damcat'; COMMENT ON TABLESPACE damcat IS 'DAMCAT Database tablespace'; -CREATE DATABASE dc_ob7oax OWNER awipsadmin TABLESPACE damcat; +CREATE DATABASE dc_ob7oax OWNER awips TABLESPACE damcat; diff --git a/edexOsgi/build.edex/opt/db/ddl/hmdb/createHMDB.sql b/edexOsgi/build.edex/opt/db/ddl/hmdb/createHMDB.sql index aa986ee134..df128d3622 100644 --- a/edexOsgi/build.edex/opt/db/ddl/hmdb/createHMDB.sql +++ b/edexOsgi/build.edex/opt/db/ddl/hmdb/createHMDB.sql @@ -20,6 +20,6 @@ \set ON_ERROR_STOP 1 DROP DATABASE IF EXISTS hmdb; DROP TABLESPACE IF EXISTS hmdb; -CREATE TABLESPACE hmdb OWNER awipsadmin LOCATION '%{tablespace_dir}%/hmdb'; +CREATE TABLESPACE hmdb OWNER awips LOCATION '%{tablespace_dir}%/hmdb'; COMMENT ON TABLESPACE hmdb IS 'HMDB Database tablespace'; -CREATE DATABASE hmdb OWNER awipsadmin TABLESPACE hmdb; +CREATE DATABASE hmdb OWNER awips TABLESPACE hmdb; diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDb.sql b/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDb.sql index d1bd21cd7a..1feca1c346 100644 --- a/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDb.sql +++ b/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDb.sql @@ -20,14 +20,14 @@ \set ON_ERROR_STOP 1 DROP DATABASE IF EXISTS maps; DROP TABLESPACE IF EXISTS maps; -CREATE TABLESPACE maps owner awipsadmin location '%{tablespace_dir}%/maps'; -CREATE DATABASE maps OWNER awipsadmin TABLESPACE maps; +CREATE TABLESPACE maps owner awips location '%{tablespace_dir}%/maps'; +CREATE DATABASE maps OWNER awips TABLESPACE maps; \connect maps BEGIN TRANSACTION; GRANT CONNECT, TEMPORARY ON DATABASE maps TO awips; -CREATE SCHEMA mapdata AUTHORIZATION awipsadmin; +CREATE SCHEMA mapdata AUTHORIZATION awips; GRANT USAGE ON SCHEMA mapdata to awips; ALTER DEFAULT PRIVILEGES IN SCHEMA mapdata GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER, TRUNCATE ON TABLES TO awips; @@ -40,7 +40,7 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO awips; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO awips; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TYPES TO awips; -CREATE SCHEMA topology AUTHORIZATION awipsadmin; +CREATE SCHEMA topology AUTHORIZATION awips; GRANT USAGE ON SCHEMA topology to awips; ALTER DEFAULT PRIVILEGES IN SCHEMA topology GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER, TRUNCATE ON TABLES TO awips; diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDbSnapshot.sh b/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDbSnapshot.sh index 0210867c09..fadc19d417 100755 --- a/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDbSnapshot.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/createMapsDbSnapshot.sh @@ -34,7 +34,7 @@ if [ $# -lt 1 ] ; then fi PGBINDIR=/awips2/postgresql/bin -PGUSER=awipsadmin +PGUSER=awips PGPORT=5432 if [ -z $1 ] ; then diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/importGeoJSONFile.sh b/edexOsgi/build.edex/opt/db/ddl/maps/importGeoJSONFile.sh index e66095cf7b..717610b37e 100644 --- a/edexOsgi/build.edex/opt/db/ddl/maps/importGeoJSONFile.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/importGeoJSONFile.sh @@ -20,7 +20,7 @@ echo usage: `basename $0` filePath fileName schema tableName [AWIPS2_install_dir echo " schema - database schema, usually mapdata, where the GeoJSON file is to be imported" echo " tableName - database table name where the GeoJSON file is to be imported" echo " AWIPS2_install_dir - optional special AWIPS2 install directory if not /awips2" - echo " dbUser - optional database user id, default to awipsadmin" + echo " dbUser - optional database user id, default to awips" echo " dbPort - optional database port number" echo " simplev - optional list of geometry simplification levels to be created" } @@ -50,7 +50,7 @@ else fi if [ -z "${6}" ] ; then - PGUSER=awipsadmin + PGUSER=awips else PGUSER=${6} fi diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/importMarkersInfo.sh b/edexOsgi/build.edex/opt/db/ddl/maps/importMarkersInfo.sh index 7aca2b94ef..5e8f0d6ac4 100755 --- a/edexOsgi/build.edex/opt/db/ddl/maps/importMarkersInfo.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/importMarkersInfo.sh @@ -36,7 +36,7 @@ SCHEMA=${2} TABLE=`echo "${3}" | tr '[:upper:]' '[:lower:]'` if [ -z $4 ] ; then - PGUSER=awipsadmin + PGUSER=awips else PGUSER=${4} fi diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/importPointsInfo.sh b/edexOsgi/build.edex/opt/db/ddl/maps/importPointsInfo.sh index a2220091c7..05ce55d398 100755 --- a/edexOsgi/build.edex/opt/db/ddl/maps/importPointsInfo.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/importPointsInfo.sh @@ -36,7 +36,7 @@ SCHEMA=${2} TABLE=`echo "${3}" | tr '[:upper:]' '[:lower:]'` if [ -z $4 ] ; then - PGUSER=awipsadmin + PGUSER=awips else PGUSER=${4} fi diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/importShapeFile.sh b/edexOsgi/build.edex/opt/db/ddl/maps/importShapeFile.sh index adc7bbdfe3..6e7079077a 100755 --- a/edexOsgi/build.edex/opt/db/ddl/maps/importShapeFile.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/importShapeFile.sh @@ -72,7 +72,7 @@ if [[ "${TABLE}" == "mapdata" && $# -gt 2 ]] ; then TABLE=`echo "${3}" | tr '[:upper:]' '[:lower:]'` fi -PGUSER=awipsadmin +PGUSER=awips PGPORT=5432 PGBINDIR=/awips2/postgresql/bin/ PSQLBINDIR=/awips2/psql/bin/ diff --git a/edexOsgi/build.edex/opt/db/ddl/maps/initializeMapsDb.sh b/edexOsgi/build.edex/opt/db/ddl/maps/initializeMapsDb.sh index 4560f216c6..51ed391143 100755 --- a/edexOsgi/build.edex/opt/db/ddl/maps/initializeMapsDb.sh +++ b/edexOsgi/build.edex/opt/db/ddl/maps/initializeMapsDb.sh @@ -35,7 +35,7 @@ DATABASEDIR=/awips2/database/sqlScripts/share/sql/maps POSTGIS_CONTRIB=/awips2/postgresql/share/contrib/postgis-2.2 PGBINDIR=/awips2/postgresql/bin PSQLBINDIR=/awips2/psql/bin -PGUSER=awipsadmin +PGUSER=awips PGPORT=5432 ${PSQLBINDIR}/psql -d postgres -U $PGUSER -q -p $PGPORT -f ${DATABASEDIR}/createMapsDb.sql diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepDb.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepDb.sql index 41c5c9c0ad..7e1aeeffc9 100644 --- a/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepDb.sql +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepDb.sql @@ -1,9 +1,9 @@ \set ON_ERROR_STOP 1 DROP DATABASE IF EXISTS ncep; DROP TABLESPACE IF EXISTS ncep; -CREATE TABLESPACE ncep OWNER awipsadmin LOCATION '%{tablespace_dir}%/ncep'; +CREATE TABLESPACE ncep OWNER awips LOCATION '%{tablespace_dir}%/ncep'; COMMENT ON TABLESPACE ncep IS 'NCEP Database tablespace'; -CREATE DATABASE ncep OWNER awipsadmin TABLESPACE ncep; +CREATE DATABASE ncep OWNER awips TABLESPACE ncep; \c ncep diff --git a/edexOsgi/build.edex/opt/db/ddl/setup/alter_database_roles_and_permissions.sh b/edexOsgi/build.edex/opt/db/ddl/setup/alter_database_roles_and_permissions.sh index bcb7c1b815..1623a3ce93 100755 --- a/edexOsgi/build.edex/opt/db/ddl/setup/alter_database_roles_and_permissions.sh +++ b/edexOsgi/build.edex/opt/db/ddl/setup/alter_database_roles_and_permissions.sh @@ -2,7 +2,7 @@ # alters all database objects to be owned by awips admin. Gives CRUD roles to pg_user and awips accounts. PSQL='/awips2/psql/bin/psql' -adminUser='awipsadmin' +adminUser='awips' users=('awips' 'pguser') as_awips='sudo -u awips -i ' diff --git a/edexOsgi/build.edex/opt/db/ddl/setup/initial_setup_server.sql b/edexOsgi/build.edex/opt/db/ddl/setup/initial_setup_server.sql index 4aa4746501..bdf2bac7cc 100644 --- a/edexOsgi/build.edex/opt/db/ddl/setup/initial_setup_server.sql +++ b/edexOsgi/build.edex/opt/db/ddl/setup/initial_setup_server.sql @@ -25,28 +25,28 @@ ALTER USER %{databaseUsername} with password 'postgres' login superuser createdb createrole; CREATE USER postgres superuser; --- connect as postgres user to allow rename of primary user to awipsadmin +-- connect as postgres user to allow rename of primary user to awips \c postgres postgres -ALTER USER %{databaseUsername} rename to awipsadmin; -ALTER USER awipsadmin with password 'awips'; +ALTER USER %{databaseUsername} rename to awips; +ALTER USER awips with password 'awips'; -\c postgres awipsadmin +\c postgres awips CREATE USER awips with password 'awips' login; --Create the metadata tablespace -CREATE TABLESPACE metadata owner awipsadmin location '%{tablespace_dir}/metadata'; +CREATE TABLESPACE metadata owner awips location '%{tablespace_dir}/metadata'; --Create the database -CREATE DATABASE metadata OWNER awipsadmin TABLESPACE metadata; +CREATE DATABASE metadata OWNER awips TABLESPACE metadata; --Switch to the metadata database \c metadata; --Create the AWIPS schema GRANT CONNECT, TEMPORARY ON DATABASE metadata TO awips; -CREATE SCHEMA awips AUTHORIZATION awipsadmin; +CREATE SCHEMA awips AUTHORIZATION awips; -- Grant privileges to awips GRANT USAGE ON SCHEMA awips to awips; -- Don't grant create @@ -57,12 +57,12 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA awips GRANT ALL ON TYPES TO awips; ALTER DATABASE metadata SET search_path = awips, public, topology; -COMMENT ON ROLE awipsadmin IS 'Primary AWIPS admin user'; +COMMENT ON ROLE awips IS 'Primary AWIPS admin user'; COMMENT ON ROLE awips IS 'Primary AWIPS user'; COMMENT ON DATABASE metadata IS 'AWIPS Metadata Database'; COMMENT ON TABLESPACE metadata IS 'AWIPS Metadata Database Tablespace'; COMMENT ON SCHEMA awips IS 'AWIPS Schema'; -CREATE TABLESPACE pgdata_ihfs OWNER awipsadmin LOCATION '%{tablespace_dir}/pgdata_ihfs'; +CREATE TABLESPACE pgdata_ihfs OWNER awips LOCATION '%{tablespace_dir}/pgdata_ihfs'; COMMENT ON TABLESPACE pgdata_ihfs IS 'IHFS Database tablespace'; diff --git a/edexOsgi/build.edex/opt/db/replication/replication-config.sh b/edexOsgi/build.edex/opt/db/replication/replication-config.sh index f52291d6be..5bee86ab5a 100755 --- a/edexOsgi/build.edex/opt/db/replication/replication-config.sh +++ b/edexOsgi/build.edex/opt/db/replication/replication-config.sh @@ -8,7 +8,7 @@ # only need to run this once per server. psql="/awips2/psql/bin/psql" -db_superuser=awipsadmin +db_superuser=awips postgres_data_dir=/awips2/database/data cleanup_exit () { diff --git a/edexOsgi/build.edex/opt/db/replication/setup-standby.sh b/edexOsgi/build.edex/opt/db/replication/setup-standby.sh index 44af782b26..c24020bfe0 100755 --- a/edexOsgi/build.edex/opt/db/replication/setup-standby.sh +++ b/edexOsgi/build.edex/opt/db/replication/setup-standby.sh @@ -22,7 +22,7 @@ # Configuration ############################################################### # Credentials -db_superuser=awipsadmin +db_superuser=awips db_rep_user=replication # for connecting to master # Master server info diff --git a/edexOsgi/build.edex/opt/tools/gen-simple-db-creds.sh b/edexOsgi/build.edex/opt/tools/gen-simple-db-creds.sh index 6373db1c7f..9057fe0c1c 100755 --- a/edexOsgi/build.edex/opt/tools/gen-simple-db-creds.sh +++ b/edexOsgi/build.edex/opt/tools/gen-simple-db-creds.sh @@ -1,5 +1,5 @@ output_dir=output -db_users=(awips awipsadmin pguser postgres) +db_users=(awips awips pguser postgres) unpriv_db_users=(awips pguser) dn_attrs='/C=US/ST=Maryland/L=Silver Spring/O=Raytheon/OU=AWIPS' validity_days=$((30 * 365)) diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/climate.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/climate.hibernate.admin.cfg.xml index c1dfa805d7..4a20c9e7d0 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/climate.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/climate.hibernate.admin.cfg.xml @@ -17,7 +17,7 @@ jdbc:postgresql://${db.addr}:${db.port}/${climate.db.name} - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/damCatalog.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/damCatalog.hibernate.admin.cfg.xml index 5666e5c21c..0efaa69306 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/damCatalog.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/damCatalog.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/${dc.db.name} - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/fxa.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/fxa.hibernate.admin.cfg.xml index 3e15cb0b77..2da2a09cd4 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/fxa.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/fxa.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/${fxa.db.name} - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/hmdb.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/hmdb.hibernate.admin.cfg.xml index 5f8c27464d..f0fc5f33f1 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/hmdb.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/hmdb.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/${hm.db.name} - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ihfs.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ihfs.hibernate.admin.cfg.xml index 0b37eec68d..da55b44566 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ihfs.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ihfs.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/${ih.db.name} - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/maps.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/maps.hibernate.admin.cfg.xml index 5b044838f1..28c2c8c1ad 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/maps.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/maps.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/maps - awipsadmin + awips awips after_transaction diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/metadata.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/metadata.hibernate.admin.cfg.xml index cc0aff38b1..e1b045d0b7 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/metadata.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/metadata.hibernate.admin.cfg.xml @@ -34,7 +34,7 @@ jdbc:postgresql://${db.addr}:${db.port}/metadata - awipsadmin + awips awips after_transaction 100 diff --git a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ncep.hibernate.admin.cfg.xml b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ncep.hibernate.admin.cfg.xml index 5eac7b4785..1031a64638 100644 --- a/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ncep.hibernate.admin.cfg.xml +++ b/edexOsgi/deploy.edex.awips2/esb/conf/db/hibernateConfig/ncep.hibernate.admin.cfg.xml @@ -35,7 +35,7 @@ jdbc:postgresql://${db.addr}:${db.port}/ncep - awipsadmin + awips awips after_transaction diff --git a/rpms/awips2.core/Installer.database/component.spec b/rpms/awips2.core/Installer.database/component.spec index f00718aa27..3911a64583 100644 --- a/rpms/awips2.core/Installer.database/component.spec +++ b/rpms/awips2.core/Installer.database/component.spec @@ -144,7 +144,7 @@ function printFailureMessage() { AWIPS_DEFAULT_OWNER="awips" AWIPS_DEFAULT_USER="awips" -AWIPS_DEFAULT_DB_ADMIN="awipsadmin" +AWIPS_DEFAULT_DB_ADMIN="awips" AWIPS_DEFAULT_GROUP="fxalpha" AWIPS_DEFAULT_PORT="5432" @@ -278,8 +278,8 @@ fi execute_initial_sql_script ${SQL_SHARE_DIR}/initial_setup_server.sql > /dev/null 2>&1 -/awips2/psql/bin/psql -U awipsadmin -d metadata -c "CREATE EXTENSION postgis;" > /dev/null 2>&1 -/awips2/psql/bin/psql -U awipsadmin -d metadata -c "CREATE EXTENSION postgis_topology;" > /dev/null 2>&1 +/awips2/psql/bin/psql -U awips -d metadata -c "CREATE EXTENSION postgis;" > /dev/null 2>&1 +/awips2/psql/bin/psql -U awips -d metadata -c "CREATE EXTENSION postgis_topology;" > /dev/null 2>&1 execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.4/legacy.sql metadata > /dev/null 2>&1 execute_psql_sql_script ${SQL_SHARE_DIR}/permissions.sql metadata > /dev/null 2>&1 execute_psql_sql_script ${SQL_SHARE_DIR}/fxatext.sql metadata > /dev/null 2>&1 diff --git a/rpms/awips2.core/Installer.localization/component.spec b/rpms/awips2.core/Installer.localization/component.spec index 3ee77d037d..b5255e28d7 100644 --- a/rpms/awips2.core/Installer.localization/component.spec +++ b/rpms/awips2.core/Installer.localization/component.spec @@ -375,7 +375,7 @@ function restoreHydroDb() # perform the restoration echo "Restoring Database ${DAMCAT_DATABASE} ..." >> ${log_file} - ${a2_pg_restore} -U awipsadmin -C -d postgres ${hydro_db_directory}/${DAMCAT_DATABASE} \ + ${a2_pg_restore} -U awips -C -d postgres ${hydro_db_directory}/${DAMCAT_DATABASE} \ >> ${log_file} 2>&1 # do not check the return code because any errors encountered during # the restoration may cause the return code to indicate a failure even @@ -384,7 +384,7 @@ function restoreHydroDb() echo "" >> ${log_file} echo "Restoring Database ${IHFS_DATABASE} ..." >> ${log_file} - ${a2_pg_restore} -U awipsadmin -C -d postgres ${hydro_db_directory}/${IHFS_DATABASE} \ + ${a2_pg_restore} -U awips -C -d postgres ${hydro_db_directory}/${IHFS_DATABASE} \ >> ${log_file} 2>&1 # do not check the return code because any errors encountered during # the restoration may cause the return code to indicate a failure even diff --git a/rpms/awips2.core/Installer.maps-database/component.spec b/rpms/awips2.core/Installer.maps-database/component.spec index 278385680e..abe39f086c 100644 --- a/rpms/awips2.core/Installer.maps-database/component.spec +++ b/rpms/awips2.core/Installer.maps-database/component.spec @@ -132,7 +132,7 @@ fi # Is there a maps database? MAPS_DB_EXISTS="false" -MAPS_DB=`${PSQL} -U awipsadmin -l | grep maps | awk '{print $1}'` +MAPS_DB=`${PSQL} -U awips -l | grep maps | awk '{print $1}'` if [ "${MAPS_DB}" = "maps" ]; then MAPS_DB_EXISTS="true" # We Have a Maps Database, There Is Nothing To Do. @@ -152,27 +152,27 @@ if [ "${MAPS_DB_EXISTS}" = "false" ]; then # Run the setup sql for the maps database. SQL_FILE="/awips2/database/sqlScripts/share/sql/maps/createMapsDb.sql" su - ${DB_OWNER} -c \ - "${PSQL} -d postgres -U awipsadmin -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1 + "${PSQL} -d postgres -U awips -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1 RC=$? if [ ! "${RC}" -eq 0 ]; then printFailureMessage fi su - ${DB_OWNER} -c \ - "${PSQL} -d maps -U awipsadmin -q -p 5432 -c \"CREATE EXTENSION postgis;\"" >> ${SQL_LOG} 2>&1 + "${PSQL} -d maps -U awips -q -p 5432 -c \"CREATE EXTENSION postgis;\"" >> ${SQL_LOG} 2>&1 if [ $? -ne 0 ]; then printFailureMessage fi su - ${DB_OWNER} -c \ - "${PSQL} -d maps -U awipsadmin -q -p 5432 -c \"CREATE EXTENSION postgis_topology;\"" >> ${SQL_LOG} 2>&1 + "${PSQL} -d maps -U awips -q -p 5432 -c \"CREATE EXTENSION postgis_topology;\"" >> ${SQL_LOG} 2>&1 if [ $? -ne 0 ]; then printFailureMessage fi SQL_FILE="/awips2/postgresql/share/contrib/postgis-2.4/legacy.sql" su - ${DB_OWNER} -c \ - "${PSQL} -d maps -U awipsadmin -q -p 5432 -f ${SQL_FILE}" >>${SQL_LOG} 2>&1 + "${PSQL} -d maps -U awips -q -p 5432 -f ${SQL_FILE}" >>${SQL_LOG} 2>&1 if [ $? -ne 0 ]; then printFailureMessage fi @@ -180,10 +180,10 @@ if [ "${MAPS_DB_EXISTS}" = "false" ]; then # Import the data into the maps database. DB_ARCHIVE="/awips2/database/sqlScripts/share/sql/maps/maps.db" su - ${DB_OWNER} -c \ - "${PG_RESTORE} -d maps -U awipsadmin -p 5432 -n mapdata ${DB_ARCHIVE}" >> ${SQL_LOG} 2>&1 + "${PG_RESTORE} -d maps -U awips -p 5432 -n mapdata ${DB_ARCHIVE}" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${PG_RESTORE} -d maps -U awipsadmin -p 5432 -n public -t geometry_columns -a ${DB_ARCHIVE}" \ + "${PG_RESTORE} -d maps -U awips -p 5432 -n public -t geometry_columns -a ${DB_ARCHIVE}" \ >> ${SQL_LOG} 2>&1 fi @@ -255,22 +255,22 @@ if [ ! "${RC}" = "0" ]; then fi # Is there a maps database? -MAPS_DB=`${PSQL} -U awipsadmin -l | grep maps | awk '{print $1}'` +MAPS_DB=`${PSQL} -U awips -l | grep maps | awk '{print $1}'` if [ "${MAPS_DB}" = "maps" ]; then # drop the maps database su - ${DB_OWNER} -c \ - "${DROPDB} -U awipsadmin maps" >> ${SQL_LOG} + "${DROPDB} -U awips maps" >> ${SQL_LOG} fi # Is there a maps tablespace? # ask psql where the maps tablespace is ... -MAPS_DIR=`${PSQL} -U awipsadmin -d postgres -c "\db" | grep maps | awk '{print $5}'` +MAPS_DIR=`${PSQL} -U awips -d postgres -c "\db" | grep maps | awk '{print $5}'` if [ ! "${MAPS_DIR}" = "" ]; then # drop the maps tablespace su - ${DB_OWNER} -c \ - "${PSQL} -U awipsadmin -d postgres -c \"DROP TABLESPACE maps\"" >> ${SQL_LOG} + "${PSQL} -U awips -d postgres -c \"DROP TABLESPACE maps\"" >> ${SQL_LOG} # remove the maps data directory that we created if [ -d "${MAPS_DIR}" ]; then diff --git a/rpms/awips2.core/Installer.ncep-database/component.spec b/rpms/awips2.core/Installer.ncep-database/component.spec index 5f7b860298..f69b996a00 100644 --- a/rpms/awips2.core/Installer.ncep-database/component.spec +++ b/rpms/awips2.core/Installer.ncep-database/component.spec @@ -120,19 +120,19 @@ perl -p -i -e "s/%{tablespace_dir}%/${TABLESPACE_DIR_ESCAPED}/g" \ su - ${DB_OWNER} -c \ - "${PSQL} -d postgres -U awipsadmin -q -p 5432 -f ${SQL_SHARE_DIR}/createNcepDb.sql" >> ${SQL_LOG} 2>&1 + "${PSQL} -d postgres -U awips -q -p 5432 -f ${SQL_SHARE_DIR}/createNcepDb.sql" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${PSQL} -d postgres -U awipsadmin -q -p 5432 -f ${SQL_SHARE_DIR}/createNcepSchemas.sql" >> ${SQL_LOG} 2>&1 + "${PSQL} -d postgres -U awips -q -p 5432 -f ${SQL_SHARE_DIR}/createNcepSchemas.sql" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${PSQL} -d ncep -U awipsadmin -q -p 5432 -c \"CREATE EXTENSION postgis;\"" >> ${SQL_LOG} 2>&1 + "${PSQL} -d ncep -U awips -q -p 5432 -c \"CREATE EXTENSION postgis;\"" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${PSQL} -d ncep -U awipsadmin -q -p 5432 -c \"CREATE EXTENSION postgis_topology;\"" >> ${SQL_LOG} 2>&1 + "${PSQL} -d ncep -U awips -q -p 5432 -c \"CREATE EXTENSION postgis_topology;\"" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${PSQL} -d ncep -U awipsadmin -q -p 5432 -f ${LEGACY_SQL}" >> ${SQL_LOG} 2>&1 + "${PSQL} -d ncep -U awips -q -p 5432 -f ${LEGACY_SQL}" >> ${SQL_LOG} 2>&1 su - ${DB_OWNER} -c \ - "${SQL_SHARE_DIR}/createNcepDb.sh ${PSQL_INSTALL} 5432 awipsadmin ${SQL_SHARE_DIR} ${SQL_LOG}" + "${SQL_SHARE_DIR}/createNcepDb.sh ${PSQL_INSTALL} 5432 awips ${SQL_SHARE_DIR} ${SQL_LOG}" su - ${DB_OWNER} -c \ - "${SQL_SHARE_DIR}/initializeNcepDb.sh ${POSTGRESQL_INSTALL} awipsadmin 5432 ${SQL_SHARE_DIR} ${SQL_LOG}" + "${SQL_SHARE_DIR}/initializeNcepDb.sh ${POSTGRESQL_INSTALL} awips 5432 ${SQL_SHARE_DIR} ${SQL_LOG}" su - ${DB_OWNER} -c \ "${DATABASE_INSTALL}/sqlScripts/share/sql/alter_database_roles_and_permissions.sh ncep" >> ${SQL_LOG} 2>&1 @@ -187,16 +187,15 @@ if [ ! "${RC}" = "0" ]; then fi su - ${DB_OWNER} -c \ - "${DROPDB} -U awipsadmin ncep" + "${DROPDB} -U awips ncep" # Is there a ncep tablespace? # ask psql where the ncep tablespace is ... -NCEP_DIR=`${PSQL} -U awipsadmin -d postgres -c "\db" | grep ncep | awk '{print $5}'` +NCEP_DIR=`${PSQL} -U awips -d postgres -c "\db" | grep ncep | awk '{print $5}'` if [ ! "${NCEP_DIR}" = "" ]; then - echo "Dropping ncep tablespace..." su - ${DB_OWNER} -c \ - "${PSQL} -U awipsadmin -d postgres -c \"DROP TABLESPACE ncep\"" + "${PSQL} -U awips -d postgres -c \"DROP TABLESPACE ncep\"" > /dev/null 2>&1 # remove the maps data directory that we created if [ -d "${NCEP_DIR}" ]; then