[systemd-devel] Fwd: dovecot and systemd

Lennart Poettering lennart at poettering.net
Fri Mar 16 18:19:42 PDT 2012


On Fri, 16.03.12 15:55, Michal Hlavinka (mhlavink at redhat.com) wrote:

> >>For example, lets have dovecot configured to listen for imap(s) and lets
> >>have systemd dovecot socket configured to listen for all protocols -
> >>pop3(s) and imap(s). When dovecot is configured to start on boot,
> >>systemd will start it and dovecot will listen on imap(s) ports. But when
> >>dovecot.socket is enabled, it'll listen on pop3(s) too and when new pop3
> >>connection comes, it'll pass it to dovecot and dovecot will serve it.
> >>The question is: Should this happen? What exactly should happen when
> >>dovecot.conf does not match dovecot.socket configuration?
> >>
> >>Michal
> >
> >Dovecot's systemd code was written by one of you Redhat guys. I had some
> >similar thoughts when I applied the patch, but didn't really know what
> >to do about it, so I didn't do anything. So: I don't know. Maybe some
> >other project has solved this somehow already?
> >
> >Dovecot anyway needs its own internal UNIX listeners. Should all
> >internal inet listeners be disabled? Could Dovecot somehow talk to
> >systemd and ask what listeners it's using for Dovecot and log warnings
> >if they don't match?

So here's what I recommend in cases where the configuration file of the
service itself and the systemd sockets passed do not match up: honour
both. i.e. go through the list of sockets passed and match them up with
the configuration as good as possible, but also listen on all sockets
which are configured in the config file but not passed and on all
sockets passed that are not configured in the config file.

This is what we do in CUPS and what I think is a nice approach since it
basically means that any user configuration is always taken into
account.

This is also close to what Apple does for launchd usually, and I think
it's a good approach.

To match up the passed sockets with the configured sockets use
sd_is_socket() and friends.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list