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.
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)
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
Will try to review them when I have time
+*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
And clamav-milter.service was already installed when build with milter USE flag enabled