Package: postgresql-common
Version: 100
Severity: wishlist
File: /usr/bin/pg_lsclusters

G'day.

We use PostgreSQL in a fairly non-standard setup — an active/passive cluster
built around shared storage.  The PostgreSQL data directory is on the shared
storage.

By "shared storage" I mean, in this case, "a physical disk that *only* the
active server can access"; the passive server cannot see it at all.

We also use a system automation solution that uses 'pg_lsclusters' to
interrogate the state of the clusters on each machine, as part of checking
that the system is performing as it should be.


On the passive system we get the following warning out of pg_lsclusters:

Use of uninitialized value in getpwuid at /usr/bin/pg_lsclusters line 28.

This is caused by $info{'owneruid'} being undef, presumably because the data
directory does not exist, so stat returns null when asked about it.


I don't know what, if anything, sensible can be done about reporting the
value, but perhaps something like this:

%info = cluster_info $v, $c;
$info{'owner'} = defined $info{owneruid} ?
    (getpwuid $info{'owneruid'})[0] : '<unknown>';
printf $fmtstring, ($v, $c, $info{'port'},
    $info{'running'} ? "online" : "down",
    $info{'owner'}, $info{'pgdata'},
    $info{'logfile'} || 'custom');
}

That will suppress the error and effectively communicate the fact that the
ownership of the data directory is impossible to determine.

Regards,
        Daniel

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages postgresql-common depends on:
ii  adduser                       3.110      add and remove users and groups
ii  debconf [debconf-2.0]         1.5.27     Debian configuration management sy
ii  lsb-base                      3.2-23     Linux Standard Base 3.2 init scrip
ii  lsb-release                   3.2-23     Linux Standard Base version report
ii  postgresql-client-common      100        manager for multiple PostgreSQL cl
ii  procps                        1:3.2.8-1  /proc file system utilities

Versions of packages postgresql-common recommends:
ii  ssl-cert                      1.0.23     simple debconf wrapper for OpenSSL

postgresql-common suggests no packages.

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

-- 
✣ Daniel Pittman            ✉ dan...@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons
   Looking for work?  Love Perl?  In Melbourne, Australia?  We are hiring.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to