[Pkg-systemd-maintainers] systemd support for amavisd-new

Christian Dröge person at christian-droege.de
Sat Feb 8 17:05:26 GMT 2014


Hi Michael and Zbigniew,

Am 08.02.2014 10:55, schrieb Michael Stapelberg:
> Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> writes:
> 
>> On Sat, Feb 08, 2014 at 01:17:13AM +0100, Christian Dröge wrote:
>>> diff -Nru amavisd-new-2.8.0/debian/amavisd-new.amavis.service amavisd-new-2.8.0/debian/amavisd-new.amavis.service
>>> --- amavisd-new-2.8.0/debian/amavisd-new.amavis.service	1970-01-01 01:00:00.000000000 +0100
>>> +++ amavisd-new-2.8.0/debian/amavisd-new.amavis.service	2014-02-08 00:46:33.000000000 +0100
>>> @@ -0,0 +1,13 @@
>>> +[Unit]
>>> +Description=Interface between MTA and virus scanner/content filters
>>> +After=network.target
>>> +
>>> +[Service]
>>> +PIDFile=/run/amavis/amavisd.pid
>>> +ExecStart=/usr/sbin/amavisd-new foreground
>>> +ExecReload=/usr/sbin/amavisd-new reload
>>> +ExecStopPost=-/usr/bin/find /var/lib/amavis -maxdepth 1 -name 'amavis-*' -type d -exec rm -rf "{}" \;
>> You can just day -delete instead of invoking rm.
> Personally, I am unsure whether ExecStopPost is the best directive to
> use here. What happens when the service gets killed? Will ExecStopPost
> be triggered in that case?
> 
> If the intention is to get rid of these files before starting the daemon
> (because they somehow make it not work correctly), wouldn’t ExecStartPre
> be the better choice? :)

The files are deleted, because they are not needed anymore and can use a
lot of space under some circumstances. The ExecStopPost will also be
executed, when the daemon stops unexpectedly. So I guess, it does not
matter much, if this command is run before starting or after stopping
the daemon. I changed it to ExecStartPre.

I could not use the -delete option, because it seems that find does not
want to delete non-empty directories and I could not get it working
otherwise.

So I hope the patch is now correct.

Best regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amavisd_systemd_support.patch
Type: text/x-patch
Size: 2292 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20140208/29cbae29/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20140208/29cbae29/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list