Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 477540

Summary: app-antivirus/clamav-0.97.8-r1 - systemd unit files do not handle freshclam or clmilter
Product: Gentoo Linux Reporter: Harris Landgarten <harrisl>
Component: Current packagesAssignee: Gentoo systemd Team <systemd>
Status: RESOLVED FIXED    
Severity: normal CC: antivirus, net-mail+disabled
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugzilla.redhat.com/show_bug.cgi?id=801994
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 480038    
Attachments: Freshclam unit files from fedora

Description Harris Landgarten 2013-07-21 00:49:29 UTC
the openrc based /etc/init.d/clamd script checks the /etc/conf.d/clamd and starts freshclam and clmilter as daemons if the options are set in the config file.

The systemd unit files shipped with clamav only start clamd but not freshclam or clmilter and never references the /etc/conf.d/clamd config file.

I assume these unit files were copied from upstream. I have seen discussion on Fedora about the freshclam issue and it appears they handle it with a cron job.

I think a better solution would be to make clamav.target read the /etc/conf.d/clamd file and start the appropriate services with separate service files for clamd.service, freshclam.service and clmilter.service if the milter use flag is on when installed.

Any comments are appreciated.
Comment 1 Pacho Ramos gentoo-dev 2013-08-08 15:47:46 UTC
We need a patch here (maybe looking to other distributions like Arch or Mageia could help, but I don't have time just now for doing it myself)
Comment 2 Harris Landgarten 2013-08-08 17:16:45 UTC
Created attachment 355430 [details]
Freshclam unit files from fedora

I am using this now with a few path fixes. I creates a separate freshclam.service
Comment 3 Pacho Ramos gentoo-dev 2013-08-26 09:27:42 UTC
Will try to review them when I have time
Comment 4 Pacho Ramos gentoo-dev 2013-09-08 10:51:16 UTC
+*clamav-0.97.8-r2 (08 Sep 2013)
+
+  08 Sep 2013; Pacho Ramos <pacho@gentoo.org> +clamav-0.97.8-r2.ebuild,
+  +files/freshclamd.service, -clamav-0.97.8-r1.ebuild:
+  Install a service for freshclamd (#477540 by Harris Landgarten)
+

But you will need to manually add it at startup, we generally won't like to rely on conf.d files neither to to "automatic" launching of other services. From what I have seen in Arch and Fedora, I think this can be handled simply adding the desired units to be started at boot
Comment 5 Pacho Ramos gentoo-dev 2013-09-08 10:52:16 UTC
And clamav-milter.service was already installed when build with milter USE flag enabled