Fix slave PGDATA permissions: set 700 and postgres ownership before basebackup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@ chown postgres:postgres /tmp/.pgpass
|
||||
chmod 600 /tmp/.pgpass
|
||||
|
||||
rm -rf "$PGDATA"/*
|
||||
chown postgres:postgres "$PGDATA"
|
||||
chmod 700 "$PGDATA"
|
||||
su-exec postgres env PGPASSFILE=/tmp/.pgpass pg_basebackup -h db-master -D "$PGDATA" -U replicator -Fp -Xs -P -R
|
||||
|
||||
echo "hot_standby = on" >> "$PGDATA/postgresql.conf"
|
||||
|
||||
Reference in New Issue
Block a user