File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packaging/common/cfengine-hub Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,10 @@ if [ ! -d $PREFIX/state/pg/data ]; then
399
399
cp -a " $new_pgconfig_file " $PREFIX /state/pg/data/postgresql.conf
400
400
chown cfpostgres $PREFIX /state/pg/data/postgresql.conf
401
401
else
402
+ # Always use the original pg_hba.conf file, it defines access control to PostgreSQL
403
+ cp -a " $BACKUP_DIR /data/pg_hba.conf" " $PREFIX /state/pg/data/pg_hba.conf"
404
+ chown cfpostgres " $PREFIX /state/pg/data/pg_hba.conf"
405
+
402
406
# Determine which postgresql.conf file to use and put it in the right place.
403
407
if [ -f " $BACKUP_DIR /data/postgresql.conf.modified" ]; then
404
408
# User-modified file from the previous old version of CFEngine exists, try to use it.
@@ -427,6 +431,14 @@ if [ ! -d $PREFIX/state/pg/data ]; then
427
431
cp -a " $new_pgconfig_file " " $PREFIX /state/pg/data/postgresql.conf"
428
432
chown cfpostgres " $PREFIX /state/pg/data/postgresql.conf"
429
433
fi
434
+
435
+ # Preserve the recovery.conf file if it existed, it defines how this
436
+ # PostgreSQL should behave as a slave (has to be done AFTER checking/writing
437
+ # the postgresql.conf file above).
438
+ if [ -f " $BACKUP_DIR /data/recovery.conf" ]; then
439
+ cp -a " $BACKUP_DIR /data/recovery.conf" " $PREFIX /state/pg/data/recovery.conf"
440
+ chown cfpostgres " $PREFIX /state/pg/data/recovery.conf"
441
+ fi
430
442
fi
431
443
fi
432
444
You can’t perform that action at this time.
0 commit comments