diff --git a/packaging/common/cfengine-hub/postinstall.sh b/packaging/common/cfengine-hub/postinstall.sh index d0b11e19b..31e916da4 100644 --- a/packaging/common/cfengine-hub/postinstall.sh +++ b/packaging/common/cfengine-hub/postinstall.sh @@ -801,12 +801,17 @@ if [ ! -f $PREFIX/state/pg/data/postgresql.conf ]; then else pgconfig_type="PostgreSQL default" fi + cf_console echo "No existing postgresql.conf, initializing Postgres" init_postgres_dir "$new_pgconfig_file" "$pgconfig_type" fi if is_upgrade && [ -d "$BACKUP_DIR/data" ]; then + cf_console echo "Upgrade & BACKUP_DIR/data is present, proceeding with db migration" do_migration "$new_pgconfig_file" "$pgconfig_type" +else + cf_console echo "No db migration necessary, skipping" fi + (cd /tmp && su cfpostgres -c "$PREFIX/bin/pg_ctl -w -D $PREFIX/state/pg/data -l /var/log/postgresql.log start") #make sure that server is up and listening