Skip to content

could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied #4

@dmaze

Description

@dmaze
dmaze@monad:~$ docker images postgres
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
postgres            9.3                 7b9abcbfddf1        7 hours ago         482.5 MB
postgres            latest              7b9abcbfddf1        7 hours ago         482.5 MB
dmaze@monad:~$ docker run postgres
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
[...]
Success. You can now start the database server using:

    postgres -D /var/lib/postgresql/data
or
    pg_ctl -D /var/lib/postgresql/data -l logfile start

FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied

If I log into the container directly, I see the directory /var/run/postgresql/ is mode 2775 owned by root:root, so the postgres:postgres user:group can't actually create a pid file there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions