Skip to content

Custom unix_socket_directories #935

Closed
@Roysten

Description

@Roysten

Hello,

I have a configuration with PostgreSQL 10.4 which has worked well for many years. I am now trying to upgrade to 14.2, but I run into some issues. I can reproduce this using just the base image. The following fails:

docker container run --rm --name test -e POSTGRES_DB=symfony -e POSTGRES_USER=symfony -e POSTGRES_PASSWORD=symfony postgres:14.2-alpine postgres -c unix_socket_directories=/tmp

The same configuration did work in 10.4:

docker container run --rm --name test -e POSTGRES_DB=symfony -e POSTGRES_USER=symfony -e POSTGRES_PASSWORD=symfony postgres:10.4-alpine postgres -c unix_socket_directories=/tmp

Has something changed regarding the unix_socket_directories?

I get the following logs:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... sh: locale: not found
2022-02-21 14:25:57.360 UTC [30] WARNING:  no usable system locales were found
ok
syncing data to disk ... initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
ok


Success. You can now start the database server using:

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

waiting for server to start....2022-02-21 14:25:57.927 UTC [36] LOG:  starting PostgreSQL 14.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-02-21 14:25:57.929 UTC [36] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-02-21 14:25:57.955 UTC [37] LOG:  database system was shut down at 2022-02-21 14:25:57 UTC
2022-02-21 14:25:57.964 UTC [36] LOG:  database system is ready to accept connections
 done
server started
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?

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