Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 801994 - freshclam (clamav-update) does not integrate with systemd or SYSV sysinit at installation
Summary: freshclam (clamav-update) does not integrate with systemd or SYSV sysinit at ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clamav
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-10 05:22 UTC by Scott Marshall
Modified: 2020-02-10 01:42 UTC (History)
10 users (show)

Fixed In Version: clamav-0.101.5-7.fc31
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-10 01:42:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Tar file containing necessary additional config files for freshclam to work with systemd and tmpfiles (10.00 KB, application/tar)
2012-03-10 05:22 UTC, Scott Marshall
no flags Details

Description Scott Marshall 2012-03-10 05:22:41 UTC
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.

Comment 1 Scott Marshall 2012-03-10 05:41:12 UTC
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.

Comment 2 Enrico Scholz 2012-04-23 08:12:40 UTC
freshclam is invoked by a cron job atm.  What are the reasons why you want to execute it as a long running daemon?

Comment 3 Sergio Basto 2012-04-23 19:30:15 UTC
(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

Comment 4 Scott Marshall 2012-04-24 00:45:07 UTC
(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.

Comment 5 Scott Marshall 2012-04-24 00:46:11 UTC
Sorry - in the above reply, I meant to say "... did NOT appear to create ...."

Comment 6 Sergio Basto 2012-04-24 22:20:09 UTC
(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 .

Comment 7 Scott Marshall 2012-04-25 01:07:27 UTC
(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.

Comment 8 Scott Marshall 2012-04-25 01:19:02 UTC
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.

Comment 9 Fedora End Of Life 2013-01-16 13:29:38 UTC
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

Comment 10 Fedora End Of Life 2013-02-13 14:19:11 UTC
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.

Comment 11 Sergio Basto 2013-02-18 03:40:22 UTC
still valid on F17

Comment 12 Fedora Admin XMLRPC Client 2013-02-27 21:06:14 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 13 Fedora End Of Life 2013-07-04 01:17:23 UTC
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.

Comment 14 Sergio Basto 2013-07-04 21:35:59 UTC
I think this still need review ...

Comment 15 Sergio Basto 2013-10-13 02:43:12 UTC
(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

Comment 16 William Graham 2014-01-17 19:52:10 UTC
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.

Comment 17 Jan Kurik 2015-07-15 15:11:02 UTC
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

Comment 18 Fedora End Of Life 2016-11-24 10:37:40 UTC
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.

Comment 19 Fedora End Of Life 2016-12-20 12:11:50 UTC
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.

Comment 20 Sergio Basto 2018-09-30 00:05:38 UTC
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 .

Comment 21 Ben Cotton 2019-02-19 17:08:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30'.

Comment 22 Fedora Update System 2020-01-24 22:22:40 UTC
FEDORA-2020-7e948a3067 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-7e948a3067

Comment 23 Fedora Update System 2020-01-30 22:59:06 UTC
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

Comment 24 Fedora Update System 2020-02-01 02:03:12 UTC
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

Comment 25 Fedora Update System 2020-02-03 00:23:50 UTC
FEDORA-EPEL-2020-69025a53b9 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-69025a53b9

Comment 26 Fedora Update System 2020-02-06 01:26:10 UTC
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

Comment 27 Fedora Update System 2020-02-10 01:42:10 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.