# HG changeset patch # User Paul Boddie # Date 1459716088 -7200 # Node ID 1cd51c7b72e7345dade28e52ec4b303d7965fc15 # Parent 08577002f5e9e09c94ebef2d871fe2ba0b006314 Use the appropriate system user when initialising database objects. diff -r 08577002f5e9 -r 1cd51c7b72e7 tools/config.sh --- a/tools/config.sh Sun Apr 03 22:39:53 2016 +0200 +++ b/tools/config.sh Sun Apr 03 22:41:28 2016 +0200 @@ -9,7 +9,8 @@ # Store-specific settings. -# For STORE_TYPE=postgresql: +# For STORE_TYPE=postgresql... POSTGRESQL_DB=imip_agent POSTGRESQL_USERS="imip-agent www-data" +AS_POSTGRES="sudo -u postgres" diff -r 08577002f5e9 -r 1cd51c7b72e7 tools/init.sh --- a/tools/init.sh Sun Apr 03 22:39:53 2016 +0200 +++ b/tools/init.sh Sun Apr 03 22:41:28 2016 +0200 @@ -92,7 +92,7 @@ # Check for the database. - if psql -tA -c 'select datname from pg_database' postgres | grep -q ^"$POSTGRESQL_DB"$ ; then + if $AS_POSTGRES psql -tA -c 'select datname from pg_database' postgres | grep -q ^"$POSTGRESQL_DB"$ ; then cat 1>&2 <&2 <&2 <&2 <