From 8941a8569e21e7f98c4827ef676c84a582cca9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20Wikstr=C3=B6m?= Date: Sat, 1 Jan 2022 13:56:17 +0100 Subject: [PATCH] new arg "fix_perm" podman volume does not give new volumes permissions that match the original parmissions. --- run.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/run.sh b/run.sh index 454239d..712c36b 100755 --- a/run.sh +++ b/run.sh @@ -12,6 +12,17 @@ function setPostgresPassword() { sudo -u postgres psql -c "ALTER USER renderer PASSWORD '${PGPASSWORD:-renderer}'" } +function fix_perm() { + # podman volume does not give new volumes + # permissions that match the original parmissions. + # correct this here + + #chown postgres.postgres /var/lib/postgresql/12/main + #chown renderer.root /var/lib/mod_tile + chmod 750 /var/lib/postgresql/12/main + chmod 755 /var/lib/mod_tile +} + if [ "$#" -ne 1 ]; then echo "usage: " echo "commands:" @@ -25,6 +36,12 @@ fi set -x +if [ "$1" = "fix_perm" ]; then + # this must be done before import + fix_perm + exit 0 +fi + if [ "$1" = "import" ]; then # Ensure that database directory is in right state chown postgres:postgres -R /var/lib/postgresql