Re: 'pg_ctl -w' times out when unix_socket_directory is

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 'pg_ctl -w' times out when unix_socket_directory is
Date: 2006-09-27 22:12:41
Message-ID: 1159395161.7578.210.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, 2006-09-27 at 14:26 -0700, Jeff Davis wrote:
> When I have "unix_socket_directory" set to an alternate value, "pg_ctl -
> D data -w start" times out. If I set it to default, it works fine.
>
> I'm using postgresql 8.1.4 on FreeBSD.
>
> Perhaps pg_ctl is waiting to see the socket file in /tmp/ before
> reporting that postgresql successfully started?
>

I took a look at the source quickly (as usual, the postgres source is so
easy to read I should have looked before I posted) and I found that the
problem seems to be in test_postmaster_connection() in pg_ctl.c.

The function checks for a non-default port, including scanning the
configuration file, but does not look for a non-default socket
directory.

It seems reasonable to add a check to find the real socket directory
before trying the connection.

I have attached a patch. I wrote it very quickly, but it seems to work
as I expect.

Regards,
Jeff Davis

Attachment Content-Type Size
pg_ctl.c.patch text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Portas 2006-09-27 22:31:10 Re: cyclical redundancy checksum algorithm(s)?
Previous Message Karen Hill 2006-09-27 21:49:28 Re: cyclical redundancy checksum algorithm(s)?

Browse pgsql-hackers by date

  From Date Subject
Next Message Matteo Beccati 2006-09-27 22:23:24 Re: -HEAD planner issue wrt hash_joins on dbt3 ?
Previous Message Jim C. Nasby 2006-09-27 21:36:43 Re: [GENERAL] Restart after power outage: createdb