amavisd loads SA directly, it does not use spamd, so the dependency in the service file is wrong. It also seems strange that it depends on postfix, while it can be used with various other mail servers.
The service file has three dependencies: Wants=postfix.service Wants=spamassassin.service Wants=clamd.service Unless there's a way to use amavisd-new with spamd that I don't know about, then you're right -- the spamassassin dependency should go. For the other two, both can optionally be used with amavisd-new but aren't required. You can have postfix/clamd installed, but be using amavisd-new with exim and no virus scanning. As such, I think those other two should be After=postfix.service After=clamd.service That way, if you're staring those other services at the same time, amavisd-new will be started last; but neither one should necessarily be started before amavisd-new just by virtue of being installed. Reference: https://www.freedesktop.org/software/systemd/man/systemd.unit.html Note: I don't actually use systemd, so someone should really double-check everything I'm saying.
Sounds reasonable to me. Changing the other two to After= seems like a good idea to me. I'm not sure if the postfix one is needed at all though. At least I am not aware of there being the need for a specific order the two have to be started in.
(In reply to Timo Rothenpieler from comment #2) > > I'm not sure if the postfix one is needed at all though. At least I am not > aware of there being the need for a specific order the two have to be > started in. In my setup, postfix will tempfail all incoming mail until amavisd-new starts. Not a big deal, but some mail servers are configured to wait a ridiculous amount of time after a 4xx error, so better to avoid it if possible.
But if it tempfails if amavisd isn't running, wouldn't Before=postfix.service be the better choice?
(In reply to Timo Rothenpieler from comment #4) > But if it tempfails if amavisd isn't running, wouldn't > Before=postfix.service be the better choice? Oh, yes, of course, thank you =)
No one else has worked on amavisd-new for a while, so I'll take care of this myself. Just to recap, I think we decided to remove: Wants=postfix.service Wants=spamassassin.service Wants=clamd.service and replace it with Before=postfix.service After=clamd.service
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8fe3982751aa4881b42f89ed080b210c4529c81 commit c8fe3982751aa4881b42f89ed080b210c4529c81 Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2018-11-17 15:09:21 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2018-11-18 23:23:57 +0000 mail-filter/amavisd-new: new version 2.11.1. A mostly standard version bump (bug 668494) with some improvements and bug fixes piled on: * The sys-apps/file dependency is replaced by dev-perl/File-LibMagic to improve performance a bit (bug 592802). * New user creation has been moved to pkg_setup(). This allows us to set permissions and ownership properly in src_install(), so that we don't have to "fix" them later and cause big ol' security problems (bug 630836). * The OpenRC service script has been rewritten to use start-stop-daemon. This fixes outstanding bugs 507352, 634860, and 646336. * The systemd service dependencies have been updated (bug 581452). We never really needed spamassassin (spamd) at all, and we shouldn't fail to start if postfix/clamav are absent entirely. * As part of the previous item, removed two failing "sed" calls (that were missing die() statements!) intended to modify a service file that no longer lives where it used to. Thanks are due to, * Marcin Mirosław who reported an OpenRC issue, * Nick Wiltshire for reporting and testing the OpenRC fixes, * Robin Lutz for reporting the OpenRC restart issue, * Timo Rothenpieler for reporting the systemd dependency issue. Bug: https://bugs.gentoo.org/630836 Closes: https://bugs.gentoo.org/507352 Closes: https://bugs.gentoo.org/581452 Closes: https://bugs.gentoo.org/592802 Closes: https://bugs.gentoo.org/634860 Closes: https://bugs.gentoo.org/646336 Closes: https://bugs.gentoo.org/668494 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 mail-filter/amavisd-new/Manifest | 1 + ...-2.11.0-r4.ebuild => amavisd-new-2.11.1.ebuild} | 68 ++++++++++++---------- mail-filter/amavisd-new/files/amavisd.initd-r2 | 42 +++++++++++++ mail-filter/amavisd-new/files/amavisd.service-r1 | 21 +++++++ 4 files changed, 101 insertions(+), 31 deletions(-)