mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
repair.sh: keep Postgres ownership of config/postgresql on bootstrapped systems.
On bootstrapped (portable) systems the cluster lives under /media/wrolpi/config/postgresql, bind-mounted over /var/lib/postgresql; the recursive chown of the config directory swept the cluster to wrolpi:wrolpi, breaking new backends. No-op on normal installs where that directory does not exist. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
7bf7d9aa66
commit
da35d39d53
1 changed files with 6 additions and 0 deletions
|
|
@ -151,6 +151,12 @@ fi
|
|||
chown wrolpi:wrolpi /media/wrolpi 2>/dev/null || echo "Ignoring failure to change media directory permissions."
|
||||
# Ensure the config directory is owned by wrolpi so the API can write config files.
|
||||
[ -d /media/wrolpi/config ] && chown -R wrolpi:wrolpi /media/wrolpi/config 2>/dev/null || :
|
||||
# On bootstrapped systems the Postgres cluster lives under config/postgresql (bind-mounted to
|
||||
# /var/lib/postgresql and /etc/postgresql). It must stay owned by postgres, or new backends
|
||||
# die with: FATAL: could not open file "global/pg_filenode.map": Permission denied.
|
||||
if [ -d /media/wrolpi/config/postgresql ] && id postgres >/dev/null 2>&1; then
|
||||
chown -R postgres:postgres /media/wrolpi/config/postgresql 2>/dev/null || :
|
||||
fi
|
||||
|
||||
# Remove immutable flag from blob files before chown (may not exist or may not be set).
|
||||
chattr -i /opt/wrolpi-blobs/* 2>/dev/null || :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue