On 19:36 Wed 17 Feb     , Jaldhar H. Vyas wrote:
> On Wed, 17 Feb 2016, Apollon Oikonomopoulos wrote:
> 
> >Package: dovecot-core
> >Version: 1:2.2.18-2+b1
> >Severity: normal
> >
> >Dear Maintainer,
> >
> >dovecot-core currently ships and enables (via dh_systemd_enable) two
> >units: dovecot.socket and dovecot.service. However, enabling
> >dovecot.socket by default is a bit problematic in this case, for the
> >following reasons:
> >
> >- dovecot.socket makes assumptions about the listening sockets; it
> >  assumes an IMAP-only setup with dovecot listening on TCP ports 143
> >  and 993, which may or may not be the case. Note that this is done
> >  even if dovecot-imapd is not installed in the system.
> >
> >- invoke-rc.d, as used in the maintainer scripts, does not handle
> >  socket units at all. This may cause unpredictable behavior during
> >  package upgrades on busy servers, since dovecot.service is stopped in
> >  prerm, but may be (re-)started anytime before the new packages have
> >  been (fully) unpacked if it is triggered by the socket unit.
> >
> >- dh_systemd_start also does not start the socket unit by default,
> >  while the socket unit will be started on the next boot,
> >  differentiating boot-time and installation-time behavior.
> >
> >- dovecot.service is enabled and started anyway during boot, so using
> >  socket activation for dovecot in this case seems to be redundant.
> >
> >IMHO, it is okay for dovecot.socket to be shipped with the package, but
> >it should not be enabled by default. Instead it should be left inactive
> >and up to the admin to decide whether to explicitly enable it or not.
> >
> 
> I must admit I am not up to speed on how systemd works.  I didn't know it
> was enabled. :-)  What is the best way to install it but leave it inactive?
> Comment it out?  Move it somewhere? Or something else?

Since dovecot.socket has been shipped since 2.2.17-1, I guess we should 
continue shipping it. However, it can be excluded from enabling it 
automatically by overriding dh_systemd_enable:

override_dh_systemd_enable:
        dh_systemd_enable -pdovecot-core dovecot.service
        dh_systemd_enable -pdovecot-core --no-enable dovecot.socket

Additionally, dovecot-core.postinst could disable dovecot.socket on 
upgrade if both it and dovecot.service are enabled.

I can commit a fix for this in the repository, after doing some tests 
for the latter part.

Regards,
Apollon

Reply via email to