endlessm / azafea

Service to track device activations and usage metrics
Mozilla Public License 2.0
10 stars 2 forks source link

Instructions for installing postgres don't work #104

Closed mcatanzaro closed 4 years ago

mcatanzaro commented 4 years ago

The instructions for installing Postgres have a couple problems. First problem is that the instructions start out using /var/lib/pgsql/ but then later switch to /var/lib/postgresql. Only the first two lines use the /var/lib/pgsql/ form, so they should probably be switched to /var/lib/postgresql.

Then the next step only works when using sudo docker rather than podman:

$ podman run --env=PGDATA=/var/lib/postgresql/azafea/data/pgdata --env=POSTGRES_PASSWORD=S3cretPgAdminP@ssw0rd --publish=5432:5432 --volume=/var/lib/postgresql/azafea/data:/var/lib/postgresql/azafea/data:rw postgres:latest
mkdir: cannot create directory ‘/var/lib/postgresql/azafea/data/pgdata’: Permission denied

At this point in the instructions, /var/lib/postgresql/azafea/data already exists and is owned by root, but /var/lib/postgresql/azafea/data/pgdata` does not exist. If I create that directory too, then the podman command fails with:

chmod: changing permissions of '/var/lib/postgresql/azafea/data/pgdata': Permission denied

At this point, I'm wondering which user is supposed to own which directories here. I understand that the next step in the installation instructions has me creating an azafea user inside the container, but no such user exists on the host system, and if I were to create that user on the host, then the uids would not match anyway. Probably this is an easy problem, but I'm a stupid desktop developer and don't know anything.

adarnimrod commented 4 years ago

@mcatanzaro you can take a look at #108. I think it should work for you now.

mcatanzaro commented 4 years ago

Thanks. I'll check this soon.

mcatanzaro commented 4 years ago

Confirmed fixed, thanks!