Bug 801994
Summary: | freshclam (clamav-update) does not integrate with systemd or SYSV sysinit at installation | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Scott Marshall <cyberrider> | ||||
Component: | clamav | Assignee: | Sergio Basto <sergio> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 30 | CC: | ainglis, fedyapupkin, herrold, ondrejj, piskozub, redhat-bugzilla, rh-bugzilla, sergio, steve, waffle.iron+fedora | ||||
Target Milestone: | --- | Keywords: | EasyFix, Patch, Reopened | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | clamav-0.101.5-7.fc31 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2020-02-10 01:42:10 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Given that systemd is the direction in which Fedora is moving, there is probably no need to create a separate -initscripts or -systemd sub-package containing these config files. It would be simpler to just ensure that the existing clamav-update package has these files, and have the clamav-update.rpm postinstall scriptlet invoke a "systemd-tmpfiles --create /etc/tmpfiles.d/freshclam.conf" command. A new preuninstall scriptlet should be created and added to the RPM to stop the service if running. Also, in my original post, the service name shown should have been "clamd.updater.service", to keep it aligned to the "clamd.scan.service" name. The "clamd.updater.service" is the actual name of the systemd file contained within the tar file. freshclam is invoked by a cron job atm. What are the reasons why you want to execute it as a long running daemon? (In reply to comment #2) > freshclam is invoked by a cron job atm. What are the reasons why you want to > execute it as a long running daemon? ok I add me has CC , because thought that has about: systemd for clamav chkconfig --list I got clamd 0:off 1:off 2:on 3:on 4:on 5:on 6:off yeah I have /etc/rc.d/init.d/clamd /etc/rc.d/init.d/clamd-wrapper rpm -qf /etc/rc.d/init.d/clamd-wrapper clamav-server-sysvinit-0.97.3-1600.fc16.noarch (In reply to comment #2) > freshclam is invoked by a cron job atm. What are the reasons why you want to > execute it as a long running daemon? When I installed the freshclam package, it did appear to create a cron job, and all the information I read about freshclam was pointing to running it as a daemon when automating the updates. I say that no cron job was created because a 'crontab -l' as root didn't show any jobs, nor was anything created in /var/spool/cron/crontabs. In the freshclam man page, there is no reference to cron, just the daemon mode for automated updating. Of course, one can infer from the fact that freshclam works as a command-line tool to update the clamav databases that it can be invoked via cron, however I was attempting to get freshclam to automatically update as per its documented capabilities and felt that the necessary systemd and tmpfiles.d configuration control files should have been included as part of the package. Sorry - in the above reply, I meant to say "... did NOT appear to create ...." (In reply to comment #2) > freshclam is invoked by a cron job atm. What are the reasons why you want to > execute it as a long running daemon? would be nice , have systemctl stop freshclam.service or systemctl start freshclam.service instead edit /etc/sysconfig/freshclam to do that . (In reply to comment #6) > > would be nice , have > systemctl stop freshclam.service or > systemctl start freshclam.service > instead edit /etc/sysconfig/freshclam to do that . I agree, which is why I created the systemd service unit file in the tarball attached to this Bugzilla record. Download the tarball to your system, then execute the following commands (as root): # cd / # tar xf /path/to/freshclam.f16.integration.tar # systemd-tmpfiles --create /etc/tmpfiles.d/freshclam.conf # systemctl enable clamd.updater.service # systemctl start clamd.updater.service There is a presumption that the Fedora standard "clamupdate" user has been created when the original "clamav-update" RPM package was installed. Don't forget to ensure that you've modified /etc/freshclam.conf to reflect your preferences. My original posting shows my setup, which is based upon the Fedora defaults but tuned to my preferences. After much stuffing around, I *did* finally find the cron job for freshclam - it was located in /etc/cron.d - specifically /etc/cron.d/clamav-update I find at least two things annoying about this setup. 1) crontab -l (even running as root) doesn't report cron jobs located in /etc/cron.d 2) If you modify the periodicity of the job in /etc/cron.d, you then have to *ALSO* change /etc/sysconfig/freshclam to reflect that change. To me, having to make the same change in two (or more) different config files is brain-dead. At least with the daemon approach, the only location needed to determine how many times to run the update check is in /etc/freshclam.conf Needless to say, I immediately deleted /etc/cron.d/clamav-update Now, freshclam only runs based upon the number of checks per 24 hours that *I* specify in /etc/freshclam.conf, not some weird combination of an invisible cron job and a "partner" file in /etc/sysconfig. This message is a reminder that Fedora 16 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '16'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 16's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 16 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. still valid on F17 This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This message is a reminder that Fedora 17 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 17. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '17'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 17's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 17 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior to Fedora 17's end of life. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. I think this still need review ... (In reply to Scott Marshall from comment #8) > After much stuffing around, I *did* finally find the cron job for freshclam > - it was located in /etc/cron.d - specifically /etc/cron.d/clamav-update > > I find at least two things annoying about this setup. > 1) crontab -l (even running as root) doesn't report cron jobs located in > /etc/cron.d > 2) If you modify the periodicity of the job in /etc/cron.d, you then have to > *ALSO* change /etc/sysconfig/freshclam to reflect that change. > > To me, having to make the same change in two (or more) different config > files is brain-dead. At least with the daemon approach, the only location > needed to determine how many times to run the update check is in > /etc/freshclam.conf > > Needless to say, I immediately deleted /etc/cron.d/clamav-update > Now, freshclam only runs based upon the number of checks per 24 hours that > *I* specify in /etc/freshclam.conf, not some weird combination of an > invisible cron job and a "partner" file in /etc/sysconfig. still this in F19 I was thinking of writing a patch myself until I saw this older bug. I think it would make sense to have a timer service like yum does. A good example is /usr/lib/systemd/system/yum-makecache.service /usr/lib/systemd/system/yum-makecache.timer In those files, timer file invokes the service every hour but only after the system has been booted for 10 minutes. Also, the timer doesn't start it's hour count until the service is complete. This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle. Changing version to '23'. (As we did not run this process for some time, it could affect also pre-Fedora 23 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23 This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. I have some scripts already prepared. My biggest concern is about update it in epel 7 , many people using it as almost official package from RedHat and this update may break updates , or duplicate him etc etc . This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle. Changing version to '30'. FEDORA-2020-7e948a3067 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-7e948a3067 clamav-0.101.5-5.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-7e948a3067 clamav-0.101.5-7.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-62f37fa1a7 FEDORA-EPEL-2020-69025a53b9 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-69025a53b9 clamav-0.101.5-9.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-dc4fead461 clamav-0.101.5-7.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report. |
Created attachment 569039 [details] Tar file containing necessary additional config files for freshclam to work with systemd and tmpfiles Description of problem: Installation of the freshclam (clamav-update) package does not setup SYSV initscripts nor does it setup a systemd service unit. Thus freshclam cannot be easily setup to automagically update at system startup. Version-Release number of selected component (if applicable): clamav-update-0.97.3-1600.fc16.x86_64 How reproducible: Always Steps to Reproduce: 1. Install the clamav-update package 2. Check the init.d and/or /lib/systemd/system directories Actual results: No service unit or init scripts present Expected results: A systemd or SYSV initscript should at least be present, even if not enabled. Additional info: I've created a systemd service unit config file, and a tmpfiles.d config file to integrate freshclam into the new Fedora 16 systemd and tmpfs environment. My /etc/freshclam.conf contains the following active settings: Checks 3 DatabaseDirectory /var/lib/clamav DatabaseOwner clamupdate LogFacility LOG_LOCAL6 LogFileMaxSize 2M LogSyslog yes LogTime yes PidFile /var/run/freshclam.pid UpdateLogFile /var/log/freshclam.log With these settings, I can execute a 'systemctl enable clamav.updater.service' and 'systemctl start clamav.updater.service', and freshclam will keep clamav up-to-date.