Skip to content

Commit 604d36e

Browse files
Update Data Directory Permission If Set Higher than 0700 (#43)
Signed-off-by: souravbiswassanto <[email protected]>
1 parent 06ba93a commit 604d36e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ trap \
1111
rm -f "$PGDATA"/postmaster.pid
1212
echo "waiting for the role to be decided ..."
1313
while true; do
14+
if [[ -d $PGDATA ]];then
15+
DIR="$PGDATA"
16+
CURRENT_PERMS=$(stat -c "%a" "$DIR")
17+
if [ "$CURRENT_PERMS" -gt 700 ]; then
18+
echo "Permissions are greater than 0700. Updating to 0700."
19+
chmod 0700 "$DIR"
20+
fi
21+
fi
22+
1423
if [[ -e /run_scripts/role/run.sh ]] && [[ "$STOP" = false ]]; then
1524
echo "running the initial script ..."
1625
if [[ $REMOTE_REPLICA == "true" ]]; then

0 commit comments

Comments
 (0)