Your message dated Thu, 05 Feb 2009 23:17:10 +0000
with message-id <e1lvdt4-0001qu...@ries.debian.org>
and subject line Bug#514132: fixed in postgresql-common 94lenny1
has caused the Debian Bug report #514132,
regarding pg_ctlcluster conflicts with instances with different
unix_socket_directory settings
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
514132: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514132
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: postgresql-common
Version: 94
Severity: Serious
pg_ctlcluster conflicts with instances with the same configured port, but
different listen_addresses and unix_socket_directory:
$ grep port db*/postgresql*
db2/postgresql.conf:port = 5432
db/postgresql.conf:port = 5432
$ grep listen_addresses db*/postgresql*
db2/postgresql.conf:listen_addresses = '192.168.0.111'
db/postgresql.conf:listen_addresses = 'localhost'
$ grep unix_socket_directory db*/postgresql*
db2/postgresql.conf:unix_socket_directory = '/var/run/postgresql/8.3/db2'
db/postgresql.conf:unix_socket_directory = '/var/run/postgresql/8.3/db'
The culprit seems to be cluster_port_running(), called by pg_ctlcluster in
the subroutine start(), to make sure the specified unix socket is not
accidently used by another running instance:
[...]
# check conflicting port
foreach my $v (get_versions) {
foreach my $c (get_version_clusters $v) {
error("Port conflict: cluster $v/$c is already running on port
" .
$info{'port'}) if cluster_port_running $v, $c,
$info{'port'};
}
}
[...]
This makes it impossible to use several instances on different
listen_addresses with the same port number. It seems to me the whole check
is far too harsh anyways: it might be sufficient to check against the
current unix socket directory only. If the connect() to this unix socket
succeeds, then there is another instance using this unix socket already. I
propose the following patch to fix the behavior of pg_ctlcluster:
diff --git a/pg_ctlcluster b/pg_ctlcluster
index 531e6b2..335e4f4 100755
--- a/pg_ctlcluster
+++ b/pg_ctlcluster
@@ -244,11 +244,12 @@ sub start {
start_check_pid_file;
# check conflicting port
- foreach my $v (get_versions) {
- foreach my $c (get_version_clusters $v) {
- error("Port conflict: cluster $v/$c is already running on port
" .
- $info{'port'}) if cluster_port_running $v, $c,
$info{'port'};
- }
+ if (cluster_port_running $version, $cluster, $info{'port'}) {
+
+ my $sockdir = PgCommon::get_conf_value $version, $cluster,
'postgresql.conf',
+ 'unix_socket_directory';
+ error("Port conflict: another instance is already running on
".$sockdir." with port ".$info{'port'});
+
}
# get locale used by initdb
--
Regards
Bernd Helmle
--- End Message ---
--- Begin Message ---
Source: postgresql-common
Source-Version: 94lenny1
We believe that the bug you reported is fixed in the latest version of
postgresql-common, which is due to be installed in the Debian FTP archive:
postgresql-client-common_94lenny1_all.deb
to pool/main/p/postgresql-common/postgresql-client-common_94lenny1_all.deb
postgresql-common_94lenny1.dsc
to pool/main/p/postgresql-common/postgresql-common_94lenny1.dsc
postgresql-common_94lenny1.tar.gz
to pool/main/p/postgresql-common/postgresql-common_94lenny1.tar.gz
postgresql-common_94lenny1_all.deb
to pool/main/p/postgresql-common/postgresql-common_94lenny1_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 514...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Martin Pitt <mp...@debian.org> (supplier of updated postgresql-common package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Fri, 06 Feb 2009 00:06:00 +0100
Source: postgresql-common
Binary: postgresql-common postgresql-client-common
Architecture: source all
Version: 94lenny1
Distribution: unstable
Urgency: high
Maintainer: Martin Pitt <mp...@debian.org>
Changed-By: Martin Pitt <mp...@debian.org>
Description:
postgresql-client-common - manager for multiple PostgreSQL client versions
postgresql-common - PostgreSQL database-cluster manager
Closes: 514132
Changes:
postgresql-common (94lenny1) unstable; urgency=high
.
* Urgency high because of RC bug fix (regression from Etch).
* pg_ctlcluster, t/030_errors.t: Back out colliding ports check
(r896), since in its current form it breaks setups where multiple
clusters listen to the same port number, but are using different
socket directories. This reopens #472627. (Closes: #514132)
Checksums-Sha1:
86fb260172cf1dd955759411fba8e4227268fac7 845 postgresql-common_94lenny1.dsc
41a06d81497bfc4116b31c8a12a9ab08447de119 111023
postgresql-common_94lenny1.tar.gz
1f4c06d70b60632e3ab5a0c0aac5ba9a4b4be6fb 116170
postgresql-common_94lenny1_all.deb
bedf0c026ef4c74157cb0b07a3879bc506fbcc43 46796
postgresql-client-common_94lenny1_all.deb
Checksums-Sha256:
8f6b29ccfd185ca9f38f35391f381e2115b01d5e595fed53fc7965d9455948c9 845
postgresql-common_94lenny1.dsc
4809ca1709b6782d87e95456d137c99efc735f1e3f048f79f3f9355497e7e09f 111023
postgresql-common_94lenny1.tar.gz
d06c00aba51e2affcd2fd7c5ebf5dae2eb73a8b6eb47ae2007185ffa2cdd8d31 116170
postgresql-common_94lenny1_all.deb
d14b2db06c155d7f8f324320d41f0699ef929290d5bb301750a7d2ad00392ed0 46796
postgresql-client-common_94lenny1_all.deb
Files:
ae729a4d2c71960d0e23bbc90691909e 845 misc optional
postgresql-common_94lenny1.dsc
a248edc49ede4f595092d1b27b2c33bc 111023 misc optional
postgresql-common_94lenny1.tar.gz
06b2e3a1672e305d5df1b561305499f3 116170 misc optional
postgresql-common_94lenny1_all.deb
73365fe86fed3ac365d88a6ce4a3aa34 46796 misc optional
postgresql-client-common_94lenny1_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkmLcc8ACgkQDecnbV4Fd/IL4QCgwSl/+9c1HhCDkRFXHBQ6ss7R
rVoAoJAlAGqIoyGsnd7dACOjuSsrhh2r
=1gHZ
-----END PGP SIGNATURE-----
--- End Message ---