Commit d2d5c1af authored by Christoph Berg's avatar Christoph Berg

The PGDG rpms are using /var/run/postgresql in 9.4+

parent 89f927b2
......@@ -392,8 +392,8 @@ $orig_egid = $);
$) = $ownergid;
$> = $owneruid;
unless ($socketdir) {
if ($PgCommon::rpm) {
$socketdir = '/tmp'; # RedHat defaults to /tmp in libpq et al.
if ($version < 9.4 and $PgCommon::rpm) {
$socketdir = '/tmp'; # PGDG 9.3 and earlier defaults to /tmp in libpq et al.
} elsif (-w '/var/run/postgresql') {
$socketdir = '/var/run/postgresql';
} else {
......
......@@ -28,7 +28,7 @@ sub check_major {
# check that a /var/run/postgresql/ pid file is created
my @contents = ('.s.PGSQL.5432', '.s.PGSQL.5432.lock', "$v-main.pid", "$v-main.pg_stat_tmp");
pop @contents if ($v < 8.4); # remove pg_stat_tmp
unless ($PgCommon::rpm) {
unless ($PgCommon::rpm and $v < 9.4) {
ok_dir '/var/run/postgresql/', [@contents],
'Socket and pid file are in /var/run/postgresql/';
} else {
......@@ -70,11 +70,11 @@ sub check_major {
# Now there should not be an external PID file any more, since we set it
# explicitly
unless ($PgCommon::rpm) {
unless ($PgCommon::rpm and $v < 9.4) {
ok_dir '/var/run/postgresql', [grep {! /pid/} @contents],
'Socket, but not PID file in /var/run/postgresql/';
'Socket and stats dir, but not PID file in /var/run/postgresql/';
} else {
ok_dir '/var/run/postgresql', [], '/var/run/postgresql/ is empty';
ok_dir '/var/run/postgresql', ["$v-main.pg_stat_tmp"], 'Only stats dir in /var/run/postgresql/';
}
# verify that the correct client version is selected
......
......@@ -260,7 +260,7 @@ is ((exec_as 'postgres', "pg_ctlcluster $version other start"), 0,
is ((exec_as 'postgres', "pg_ctlcluster $version other stop"), 0);
# ... but will give an error when running on the same port
set_cluster_socketdir $version, 'other', $PgCommon::rpm ? '/tmp' : '/var/run/postgresql';
set_cluster_socketdir $version, 'other', ($PgCommon::rpm and $version < 9.4) ? '/tmp' : '/var/run/postgresql';
like_program_out 'postgres', "pg_ctlcluster $version other start", 1,
qr/Port conflict:.*port 5432/,
'pg_ctlcluster other cluster fails on conflicting port and same socket dir';
......
......@@ -3,8 +3,10 @@ use warnings;
use lib 't';
use TestLib;
use Test::More tests => 3 + 19 * @MAJORS;
use PgCommon;
use Test::More tests => $PgCommon::rpm ? 1 : 3 + 19 * @MAJORS;
if ($PgCommon::rpm) { pass 'No ssl key checks on RedHat'; exit; }
my ($pg_uid, $pg_gid) = (getpwnam 'postgres')[2,3];
my $ssl_cert_gid = (getgrnam 'ssl-cert')[2]; # reset permissions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment