PgCommon::get_cluster_socketdir depends on unix_socket_directories setting

Bug #1446811 reported by Alex Tomic
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Triaged
Low
Unassigned

Bug Description

If postgresql.conf does not contain a unix_socket_directories setting, and the /var/run/postgresql directory does not exist, postgresql startup will fail due to underlying postgresql utilties throwing a "Cannot stat /var/run/postgresql" error.

The issue is easy to reproduce:

$ sudo /etc/init.d/postgresql stop
$ sudo rm -rf /var/run/postgresql
$ sudo perl -pi -e 's/unix_socket_directories/#unix_socket_directories/g' /etc/postgresql/9.3/main/postgresql.conf
$ psql --version
Error: Cannot stat /var/run/postgresql
$ pg_lsclusters
Error: Cannot stat /var/run/postgresql

pg_lsclusters is especially important, because it is run inside the postgresql init.d script *before* the /var/run/postgresql directory is recreated.

Adding the unix_socket_directories setting to postgresql.conf is a simple workaround. Filing this bug more for documentation purposes.

Revision history for this message
Martin Pitt (pitti) wrote :

To be honest this is mostly a wontfix. Either you do use the postgresql-common integration tools, then we need to assume that the config files from pg_createcluster don't get broken. Or you don't use the postgresql-common tools and do everything by yourself, that's also okay. But mixing the two is just too brittle, as there are so many combinations that it's hard to impossible to test them all.

Changed in postgresql-common (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.