[Pkg-postgresql-public] systemd support

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Mar 5 11:44:36 UTC 2014


On 03/05/2014 09:50 AM, Christoph Berg wrote:
> Re: Daniel Kahn Gillmor 2014-03-04 <531641AA.7040205 at fifthhorseman.net>
>> have you looked at all into the idea of a socket-activated postgresql
>> for those initsystems that can handle socket activation?
> 
> I think it would be a nice idea, but would that work with PostgreSQL?
> My impression was that it needs a daemon that takes connections on
> stdin instead of opening a socket itself.

It doesn't need to be stdin by default -- it could be another file
descriptor (or several other file descriptors, for daemons that listen
on multiple sockets).

This would definitely require coordination from postgresql upstream,
though.  i don't think the postgres binary supports this yet.  it might
be worth raising to upstream at some point though.  socket activation is
nice for at least three reasons:

 0) the process supervisor can hold the relevant sockets open so that no
other processes can grab them, even while the server in question is
being re-started).

 1) for daemons that want to listen on reserved TCP or UDP ports (i.e.
below 1024), the process supervisor can open the ports, and then the
daemon itself can be run as a non-privileged user.

 2) clients can establish a connection during a service restart, and
just have a delayed application-layer handshake, instead of getting
"port closed" messages.

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1010 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20140305/ec60b5bf/attachment.sig>


More information about the Pkg-postgresql-public mailing list