[Pkg-postgresql-public] Bug#678936: postgresql-common: init.d status doesn't list clusters that are online but in recovery.

Gilbert Roulot gilbert.roulot at tech-angels.com
Mon Jun 25 07:56:51 UTC 2012


Package: postgresql-common
Version: 130~bpo60+2
Severity: minor


Hello,

/etc/init.d/postgresql status doesn't list clusters that are online when
they are in recovery, for example when they are slaves in a streaming
replication setup.

pg_lsclusters list the cluster:
sudo pg_lsclusters -h
9.1     main      5432 online,recovery postgres /var/lib/postgresql/9.1/main       
/var/log/postgresql/postgresql-9.1-main.log

/etc/init.d/postgresql status does not:
sudo /etc/init.d/postgresql status
Running clusters:


An awk command in /usr/share/postgresql-common/init.d-functions at line 84 is 
filtering out the online recovering clusters:
    echo "$CLUSTERS" | awk 'BEGIN {rc=0; printf("Running clusters: ")} 
    {if ($4 == "online") printf ("%s/%s ", $1, $2); else rc=3} END 
    { printf("\n"); exit rc }'

A simple replacement of ($4 == "online") by (match($4, "online")) solved my
issue.


Regards.

-- System Information:
Debian Release: 6.0.5
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38.2-xxxx-std-ipv6-64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages postgresql-common depends on:
ii  adduser                3.112+nmu2        add and remove users and groups
ii  debconf [debconf-2.0]  1.5.36.1          Debian configuration management sy
ii  logrotate              3.7.8-6           Log rotation utility
ii  lsb-base               3.2-23.2squeeze1  Linux Standard Base 3.2 init scrip
ii  postgresql-client-comm 130~bpo60+2       manager for multiple PostgreSQL cl
ii  procps                 1:3.2.8-9squeeze1 /proc file system utilities
ii  ssl-cert               1.0.28            simple debconf wrapper for OpenSSL

postgresql-common recommends no packages.

postgresql-common suggests no packages.

-- debconf information:
  postgresql-common/obsolete-major:





More information about the Pkg-postgresql-public mailing list