pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedChange Unix Socket directory at build time
7+ messages / 4 participants
[nested] [flat]
* Change Unix Socket directory at build time
@ 2017-04-14 15:55 Santiago DIEZ <santiago.diez@caoba.fr>
0 siblings, 1 reply; 7+ messages in thread
From: Santiago DIEZ @ 2017-04-14 15:55 UTC (permalink / raw)
To: pgsql-admin
Hi,
I usualy change the unix_socket_directory in the server configuration but
I'd like to change it for good at build time. I read everywhere (here
<https://www.postgresql.org/docs/current/static/runtime-config-connection.html;
for example):
"unix_socket_directories (string)
The default value is normally /tmp, but that can be changed at build time."
Ok good but I've read ./configure --help and I cannot find how to do it.
Can anyone help me?
Regards
-------------------------
Santiago DIEZ
Quark Systems & CAOBA
23 rue du Buisson Saint-Louis, 75010 Paris
-------------------------
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 16:21 Andres Freund <andres@anarazel.de>
parent: Santiago DIEZ <santiago.diez@caoba.fr>
0 siblings, 1 reply; 7+ messages in thread
From: Andres Freund @ 2017-04-14 16:21 UTC (permalink / raw)
To: Santiago DIEZ <santiago.diez@caoba.fr>; +Cc: pgsql-admin
Hi,
On 2017-04-14 17:55:39 +0200, Santiago DIEZ wrote:
> I usualy change the unix_socket_directory in the server configuration but
> I'd like to change it for good at build time. I read everywhere (here
> <https://www.postgresql.org/docs/current/static/runtime-config-connection.html;
> for example):
> "unix_socket_directories (string)
> The default value is normally /tmp, but that can be changed at build time."
>
> Ok good but I've read ./configure --help and I cannot find how to do it.
You need to edit src/include/pg_config_manual.h and adapat DEFAULT_PGSOCKET_DIR
- Andres
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 16:33 Santiago DIEZ <santiago.diez@caoba.fr>
parent: Andres Freund <andres@anarazel.de>
0 siblings, 1 reply; 7+ messages in thread
From: Santiago DIEZ @ 2017-04-14 16:33 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-admin
Fantastic, I have never dug into the .h files when building any
program. That's quite new to me.
Is the # character a comment or not? It seems like all line start with #define
-------------------------
Santiago DIEZ
Quark Systems & CAOBA
23 rue du Buisson Saint-Louis, 75010 Paris
-------------------------
On Fri, Apr 14, 2017 at 6:21 PM, Andres Freund <andres@anarazel.de> wrote:
>
> Hi,
>
> On 2017-04-14 17:55:39 +0200, Santiago DIEZ wrote:
> > I usualy change the unix_socket_directory in the server configuration but
> > I'd like to change it for good at build time. I read everywhere (here
> > <https://www.postgresql.org/docs/current/static/runtime-config-connection.html;
> > for example):
> > "unix_socket_directories (string)
> > The default value is normally /tmp, but that can be changed at build time."
> >
> > Ok good but I've read ./configure --help and I cannot find how to do it.
>
> You need to edit src/include/pg_config_manual.h and adapat DEFAULT_PGSOCKET_DIR
>
> - Andres
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 16:43 Santiago DIEZ <santiago.diez@caoba.fr>
parent: Santiago DIEZ <santiago.diez@caoba.fr>
0 siblings, 1 reply; 7+ messages in thread
From: Santiago DIEZ @ 2017-04-14 16:43 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-admin
To be fully transparent, the issue I'm dealing with is the following:
If I set a specific unix_socket_directory in postgresql.conf then running
pg_ctl start -w -t5 -D '/val/lib/postgresql/9.4/main'
fails because I believe it cannot verify the server is running because
it's looking for socket in /tmp.
The command fails but the server is started and running.
I don't know if it makes any sense.
On a larger scale I only hope to solve part of the problem because if
I don't configure unix_socket_directory, then pg_ctl will wait for the
creation of a socket in /var/run/postgresql and will believe the
server is not started although it is.
So a more general question would be: "how to make sure pg_ctl expects
the socket in the right place whatever the config is?"
-------------------------
Santiago DIEZ
Quark Systems & CAOBA
23 rue du Buisson Saint-Louis, 75010 Paris
-------------------------
On Fri, Apr 14, 2017 at 6:33 PM, Santiago DIEZ <santiago.diez@caoba.fr> wrote:
> Fantastic, I have never dug into the .h files when building any
> program. That's quite new to me.
> Is the # character a comment or not? It seems like all line start with #define
>
> -------------------------
> Santiago DIEZ
> Quark Systems & CAOBA
> 23 rue du Buisson Saint-Louis, 75010 Paris
> -------------------------
>
> On Fri, Apr 14, 2017 at 6:21 PM, Andres Freund <andres@anarazel.de> wrote:
>>
>> Hi,
>>
>> On 2017-04-14 17:55:39 +0200, Santiago DIEZ wrote:
>> > I usualy change the unix_socket_directory in the server configuration but
>> > I'd like to change it for good at build time. I read everywhere (here
>> > <https://www.postgresql.org/docs/current/static/runtime-config-connection.html;
>> > for example):
>> > "unix_socket_directories (string)
>> > The default value is normally /tmp, but that can be changed at build time."
>> >
>> > Ok good but I've read ./configure --help and I cannot find how to do it.
>>
>> You need to edit src/include/pg_config_manual.h and adapat DEFAULT_PGSOCKET_DIR
>>
>> - Andres
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 17:05 David G. Johnston <david.g.johnston@gmail.com>
parent: Santiago DIEZ <santiago.diez@caoba.fr>
0 siblings, 1 reply; 7+ messages in thread
From: David G. Johnston @ 2017-04-14 17:05 UTC (permalink / raw)
To: Santiago DIEZ <santiago.diez@caoba.fr>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-admin
On Fri, Apr 14, 2017 at 9:43 AM, Santiago DIEZ <santiago.diez@caoba.fr>
wrote:
> To be fully transparent, the issue I'm dealing with is the following:
> If I set a specific unix_socket_directory in postgresql.conf then running
> pg_ctl start -w -t5 -D '/val/lib/postgresql/9.4/main'
> fails because I believe it cannot verify the server is running because
> it's looking for socket in /tmp.
>
More likely is that it takes more than 5 seconds to start and you are
timing out. (I'll presume */val* is a typo in the email only)
The source code for pg_ctl indicates that the "pid file" the postmaster
creates at startup contains the information needed for both unix and tcp
socket connections and this is where pg_ctl gets its "connection string"
information from.
Supplying logging data from the pg_ctl run would help.
David J.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 17:12 Santiago DIEZ <santiago.diez@caoba.fr>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Santiago DIEZ @ 2017-04-14 17:12 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Andres Freund <andres@anarazel.de>; pgsql-admin
no no, if I set -t to 60 seconds (or even 1000), it's the same problem.
-------------------------
Santiago DIEZ
Quark Systems & CAOBA
23 rue du Buisson Saint-Louis, 75010 Paris
-------------------------
On Fri, Apr 14, 2017 at 7:05 PM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> On Fri, Apr 14, 2017 at 9:43 AM, Santiago DIEZ <santiago.diez@caoba.fr>
> wrote:
>>
>> To be fully transparent, the issue I'm dealing with is the following:
>> If I set a specific unix_socket_directory in postgresql.conf then running
>> pg_ctl start -w -t5 -D '/val/lib/postgresql/9.4/main'
>> fails because I believe it cannot verify the server is running because
>> it's looking for socket in /tmp.
>
>
> More likely is that it takes more than 5 seconds to start and you are timing
> out. (I'll presume */val* is a typo in the email only)
>
> The source code for pg_ctl indicates that the "pid file" the postmaster
> creates at startup contains the information needed for both unix and tcp
> socket connections and this is where pg_ctl gets its "connection string"
> information from.
>
> Supplying logging data from the pg_ctl run would help.
>
> David J.
>
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Change Unix Socket directory at build time
@ 2017-04-14 17:40 Tom Lane <tgl@sss.pgh.pa.us>
parent: Santiago DIEZ <santiago.diez@caoba.fr>
0 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2017-04-14 17:40 UTC (permalink / raw)
To: Santiago DIEZ <santiago.diez@caoba.fr>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; Andres Freund <andres@anarazel.de>; pgsql-admin
Santiago DIEZ <santiago.diez@caoba.fr> writes:
> no no, if I set -t to 60 seconds (or even 1000), it's the same problem.
David's right though: any reasonably modern version of pg_ctl (since
about 9.1 I believe) gets everything it needs to know out of the
postmaster.pid file. Compiling in a different default
unix_socket_directory might save some effort when using psql or other
clients, but it should make no difference to pg_ctl.
It might be useful to strace pg_ctl to see what it's doing in the
problem case.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2017-04-14 17:40 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 15:55 Change Unix Socket directory at build time Santiago DIEZ <santiago.diez@caoba.fr>
2017-04-14 16:21 ` Andres Freund <andres@anarazel.de>
2017-04-14 16:33 ` Santiago DIEZ <santiago.diez@caoba.fr>
2017-04-14 16:43 ` Santiago DIEZ <santiago.diez@caoba.fr>
2017-04-14 17:05 ` David G. Johnston <david.g.johnston@gmail.com>
2017-04-14 17:12 ` Santiago DIEZ <santiago.diez@caoba.fr>
2017-04-14 17:40 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox