[Pkg-postgresql-public] Bug#819442: postgresql-common: pg_ctlcluster fails if data directory is not in the standard place

Oliver Elphick olly at lfix.co.uk
Mon Mar 28 14:58:07 UTC 2016


Package: postgresql-common
Version: 172
Severity: important

My PostgreSQL data directories are in /lvhome/postgresql.  The config files are
in /etc/postgresql, with appropriate changes to point to the data directories.

pg_ctlcluster reads the config files and appears to launch the pg_ctl command
with '-D /lvhome/postgresql/<version>/<cluster>'.  However the -D option to
pg_ctl specifies where the config file is to be found. (Its brief description
is misleading.)  Therefore postgresql does not start from the init script or
from systemctl.

Specifying 'pg_ctl -D /etc/postgresql/<version>/<cluster>' does work.


The solution is not to parse /etc/postgresql/<version/<cluster>/postgresql.conf
for the data directory, since this is unnecessary.

Debugging pg_ctlcluster:
DB<12> p $pg_ctl," ", @options
/usr/lib/postgresql/9.5/bin/pg_ctl
/usr/lib/postgresql/9.5/bin/pg_ctlstart-D/lvhome/postgresql/9.5/main-l/var/log/postgresql/postgresql-9.5-main.log-s-o
-c config_file="/etc/postgresql/9.5/main/postgresql.conf"



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages postgresql-common depends on:
ii  adduser                   3.114
ii  debconf [debconf-2.0]     1.5.59
ii  init-system-helpers       1.29
ii  lsb-base                  9.20160110
ii  postgresql-client-common  172
ii  procps                    2:3.3.11-3
ii  ssl-cert                  1.0.37
ii  ucf                       3.0036

Versions of packages postgresql-common recommends:
ii  logrotate  3.8.7-2

postgresql-common suggests no packages.

-- debconf information:
  postgresql-common/catversion-bump:
  postgresql-common/ssl: true
* postgresql-common/obsolete-major:



More information about the Pkg-postgresql-public mailing list