I have Postgres 7.2.1 configured to listen on TCP/IP port.
When the server starts up it still creates the socket file in /tmp.
Removing this file manually does not seem to cause any problem for the
application.

Is there a way to prevent postmaster from creating this file?
Is this really safe to remove the socket file, or would it create
some problem that I won't necessarily see?

Thanks,
Mike.



Thu, 13 Feb 2003 13:05:48 -0500
Michael Brusser <michael@synchronicity.com>
Do we always need the socket file?
Michael Brusser wrote:
> I have Postgres 7.2.1 configured to listen on TCP/IP port.
> When the server starts up it still creates the socket file in /tmp.
> Removing this file manually does not seem to cause any problem for the
> application.
> 
> Is there a way to prevent postmaster from creating this file?
> Is this really safe to remove the socket file, or would it create
> some problem that I won't necessarily see?

I guess the big question is why you don't want the file created?  If you
have 'local' disabled in pg_hba.conf, it doesn't allow connections.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Thu, 13 Feb 2003 20:38:07 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Do we always need the socket file?
We're trying to avoid creating any unnecessary files, especially outside
of the product installation tree. Look at this as a policy.
Experience shows that sooner or later some of your customers ask you:
what is this /tmp/.s.PGSQL.xxx file is? What do I need it for?
Also some admins known to periodically clean out /tmp, /var/run, etc.

Mike.

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> Sent: Thursday, February 13, 2003 8:38 PM
> To: michael@synchronicity.com
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Do we always need the socket file?
> 
> 
> Michael Brusser wrote:
> > I have Postgres 7.2.1 configured to listen on TCP/IP port.
> > When the server starts up it still creates the socket file in /tmp.
> > Removing this file manually does not seem to cause any problem for the
> > application.
> > 
> > Is there a way to prevent postmaster from creating this file?
> > Is this really safe to remove the socket file, or would it create
> > some problem that I won't necessarily see?
> 
> I guess the big question is why you don't want the file created?  If you
> have 'local' disabled in pg_hba.conf, it doesn't allow connections.
> 
> -- 
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, 
> Pennsylvania 19073
> 


Thu, 13 Feb 2003 21:33:43 -0500
Michael Brusser <michael@synchronicity.com>
Re: Do we always need the socket file?
Michael Brusser <michael@synchronicity.com> writes:

> We're trying to avoid creating any unnecessary files, especially outside
> of the product installation tree. Look at this as a policy.
> Experience shows that sooner or later some of your customers ask you:
> what is this /tmp/.s.PGSQL.xxx file is? What do I need it for?
> Also some admins known to periodically clean out /tmp, /var/run, etc.

Well if you clean out files programs are using you should expect those
programs to break. Other programs that create sockets in /tmp include screen
and X for example.

Unix domain sockets are sometimes more efficient and sometimes more secure
than TCP/IP connections. So preferring TCP/IP just to avoid /tmp pollution
might be a bit of a loss for aesthetic value.

-- 
greg


14 Feb 2003 13:19:50 -0500
Greg Stark <gsstark@mit.edu>
Re: Do we always need the socket file?