Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 739172 - dev-db/postgresql should clean up dead socket files - /etc/init.d/postgresql-12: Socket conflict. A server is already listening on: /var/run/psql/socket/.s.PGSQL.xxxx HINT: Change PGPORT to listen on a different socket.
Summary: dev-db/postgresql should clean up dead socket files - /etc/init.d/postgresql-...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-26 23:31 UTC by Conrad
Modified: 2020-09-23 09:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad 2020-08-26 23:31:24 UTC
After an unclean shutdown openrc fails to start postgres because of the still existing (but dead) socket file.

Reproducible: Always

Steps to Reproduce:
1. provoke unclean shutdown
2. rc-service postgresql-12 start
Actual Results:  
(this error message is produced by the openrc init script, not postgres)
Socket conflict.
A server is already listening on:
    /var/run/psql/socket/.s.PGSQL.5432
HINT: Change PGPORT to listen on a different socket.
ERROR: postgresql-12 failed to start

Expected Results:  
The OpenRC init script manages to start postgres despite the existence of the dead socket file.
Comment 1 Tomáš Mózes 2020-09-23 09:22:53 UTC
Having the same issue with pgsql-11. The server is rebooted, openrc shows postgresql-11 as stopped, but postgresql is running:

postgres  2137  0.0  0.0 165264 18784 ?        S    11:07   0:00 /usr/lib64/postgresql-11/bin/postgres -D /etc/postgresql-11 --data-directory=/var/lib/postgresql/11/data --unix-socket-directories=/run/postgresql

2020-09-23 11:01:40 CEST  LOG:  received smart shutdown request
2020-09-23 11:01:40 CEST  FATAL:  terminating walreceiver process due to administrator command
2020-09-23 11:01:40 CEST  LOG:  shutting down
2020-09-23 11:01:40 CEST  LOG:  database system is shut down
2020-09-23 11:07:37 CEST  LOG:  listening on IPv4 address "0.0.0.0", port 5432
2020-09-23 11:07:37 CEST  LOG:  listening on IPv6 address "::", port 5432
2020-09-23 11:07:37 CEST  LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2020-09-23 11:07:37 CEST  LOG:  database system was shut down in recovery at 2020-09-23 11:01:40 CEST
2020-09-23 11:07:37 CEST  LOG:  entering standby mode
2020-09-23 11:07:37 CEST  LOG:  redo starts at E4A/54378200
2020-09-23 11:07:48 CEST  LOG:  consistent recovery state reached at E4A/5F1046A0
2020-09-23 11:07:48 CEST  LOG:  invalid resource manager ID 65 at E4A/5F1046A0
2020-09-23 11:07:48 CEST  LOG:  database system is ready to accept read only connections
2020-09-23 11:07:48 CEST  LOG:  started streaming WAL from primary at E4A/5F000000 on timeline 1