Summary: | mail-filter/amavisd-new: systemd unit | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | David Heidelberg (okias) <david> |
Component: | Current packages | Assignee: | Antivirus Team <antivirus> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | net-mail+disabled, systemd |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 448882 | ||
Attachments: |
amavisd.service
amavisd-new.ebuild.patch |
Description
David Heidelberg (okias)
2014-01-11 03:12:41 UTC
Oops, sorry, this works. --- [Unit] Description=Amavisd Daemon Wants=postfix.service Wants=spamassassin.service After=network.target [Service] PIDFile=/run/amavis/pid ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf foreground ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload [Install] WantedBy=multi-user.target Why do you need "PIDFile" even running in foreground? @pacho No idea, I just took systemd unit from Arch Linux, not sure why they did it. Created attachment 367658 [details] amavisd.service Please try this one, I have doubts about what list in Wants :/, it supposedly should work with any virtual/mta provider with unit files, also, looks like opensuse is adding Wants=clamd.service (equivalent to current init.d) instead of spamassassin: http://download.opensuse.org/repositories/openSUSE:/13.1:/Update/standard/src/amavisd-new-2.8.1-2.8.1.src.rpm Wants=clamd.service should be included in case we add mail-filter/amavisd-new-2.8.1[clamd] which will leave this line in systemd file, otherwise sed -i /clamd/d I can't test right now (server is running and I can't just change services in this moment). Otherwise, when we got final solution, I'll replace that file and in soon reboot test. OK, @systemd, any suggestions? Maybe I should create bug report for adding clamd USE to amavisd-new ? File from SuSE. There should be both, clamd and spamassasin depending on USE flags. ========================= [Unit] Description=Amavisd-new Virus Scanner interface Requires=var-run.mount Wants=nss-lookup.target network.target remote-fs.target time-sync.target After=var-run.mount nss-lookup.target network.target remote-fs.target time-sync.target Wants=named.service clamd.service After=named.service clamd.service Before=mail-transfer-agent.target [Service] Type=forking PIDFile=/var/spool/amavis/amavisd.pid ExecStartPre=-/bin/echo 'Starting virus-scanner (amavisd-new):' EnvironmentFile=-/etc/sysconfig/amavisd ExecStartPre=/usr/sbin/amavisd-milter.sh start ExecStart=/usr/sbin/amavisd start ExecStartPost= ExecStartPost= ExecReload=/usr/sbin/amavisd reload ExecStop=/usr/sbin/amavisd stop ExecStopPost=/usr/sbin/amavisd-milter.sh stop [Install] WantedBy=multi-user.target [Unit] Description=Amavisd Daemon Wants=postfix.service Wants=spamassassin.service Wants=clamd.service After=network.target [Service] PIDFile=/run/amavis/pid ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf foreground ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload [Install] WantedBy=multi-user.target I'd like to propose at least this, as solution, it works someway, can this be accepted (better than nothing)? then if ebuild if !use clamd; then sed /Wants=clamd/d "${ED}"/usr/lib/systemd/system/amavisd.service fi if !use spamassasin; then sed /Wants=spamassassin/d "${ED}"/usr/lib/systemd/system/amavisd.service fi Is this acceptable? Should I create patches? +*amavisd-new-2.8.1-r1 (15 Feb 2014) + + 15 Feb 2014; Pacho Ramos <pacho@gentoo.org> +amavisd-new-2.8.1-r1.ebuild, + +files/amavisd.service: + Add unit file (#497756 by David Heidelberger (okias)) + That damn good, I'll retest ASAP! Created attachment 370490 [details, diff]
amavisd-new.ebuild.patch
Well, there is few typos in that commit, here is fix.
I saw this comment here after fixing it ;) Thanks! |