Bug 756854 - clamd package lacks certain config files
Summary: clamd package lacks certain config files
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: clamav
Version: el6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steven Pritchard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-24 20:44 UTC by Philip Prindeville
Modified: 2020-09-07 17:07 UTC (History)
7 users (show)

Fixed In Version: clamav-0.97.3-2.el6
Clone Of:
Environment:
Last Closed: 2011-12-30 20:05:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Add missing init and sysconfig files; clean up wrapper script (11.49 KB, patch)
2011-11-26 00:08 UTC, Philip Prindeville
no flags Details | Diff

Description Philip Prindeville 2011-11-24 20:44:57 UTC
Description of problem:

The following Fedora files need to find their way into the EPEL branch:

clamd.SERVICE.init
clamav-update.cron
clamav-update.logrotate
clamd.logrotate
clamd-README

and maybe more complete README documents for installation.

Version-Release number of selected component (if applicable):

0.97.3-1

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Philip Prindeville 2011-11-24 22:15:10 UTC
I should also add that I've taken the lastest fc16.src.rpm and mock built it as epel-6-x86_64 successfully.

Comment 2 Kevin Fenzi 2011-11-24 23:26:47 UTC
The clamd package should have a init file, logrotate and readme. 

The clamav-db package has the update and logrotate. 

What functionality is missing?

Comment 3 Philip Prindeville 2011-11-25 00:19:15 UTC
(In reply to comment #2)
> The clamd package should have a init file, logrotate and readme. 
> 
> The clamav-db package has the update and logrotate. 
> 
> What functionality is missing?

The sysconfig file would be a start.

Comment 4 Kevin Fenzi 2011-11-25 18:02:35 UTC
Hum. I'm not sure I see a sysconfig file in the Fedora packaging either. Can you elaborate on what this file is/would do?

Comment 5 Philip Prindeville 2011-11-25 21:19:17 UTC
(In reply to comment #4)
> Hum. I'm not sure I see a sysconfig file in the Fedora packaging either. Can
> you elaborate on what this file is/would do?

[root@mail clamav-server-0.97.3]# rpm -qa --filesbypkg clamav* clamd* | grep sysconfig
clamav-update             /etc/sysconfig/freshclam
clamav-server             /usr/share/doc/clamav-server-0.97.3/clamd.sysconfig
[root@mail clamav-server-0.97.3]# cat clamd.sysconfig
#CLAMD_CONFIGFILE=/etc/clamd.d/<SERVICE>.conf
#CLAMD_SOCKET=/var/run/clamd.<SERVICE>/clamd.sock
#CLAMD_OPTIONS=
[root@mail clamav-server-0.97.3]# cat clamd.init
#!/bin/bash
#
# chkconfig: - 75 35
# description: The clamd server running for <SERVICE>

CLAMD_SERVICE=<SERVICE>
. /usr/share/clamav/clamd-wrapper
[root@mail clamav-server-0.97.3]# 

If you look at /usr/share/clamav/clamd-wrapper, you'll see that it sets up (defaults?) on some of the values that are supposed to be inherited from clamd.sysconfig (but will be defaulted in the absence of that file).

It's not clear why EL needs both the clamav.init and the 2nd tarball's clamd-wrapper.

I'll also note that you don't need to specify the pidfile on the command line in the clamd-wrapper:

        daemon --pidfile=${CLAMD_PIDFILE} \
            exec -a $procname /usr/sbin/clamd \
            ${CLAMD_CONFIGFILE:+-c $CLAMD_CONFIGFILE} ${CLAMD_OPTIONS} --pid ${CLAMD_PIDFILE}

since it already came out of the config a few lines above:

CLAMD_PIDFILE=`grep ^PidFile ${CLAMD_CONFIGFILE} | awk '{print $2}'`

I would note, though, that I'd grep the PID value *after* sourcing the CONFIGFILE, i.e.:

test -f "$sysconffile" && . "$sysconffile"
CLAMD_PIDFILE=`grep ^PidFile ${CLAMD_CONFIGFILE} | awk '{print $2}'`

just in case the sysconfig file changed the values of CLAMD_CONFIGFILE.

It also raises the question of "should the sysconffile be allowed to specify a CLAMD_PIDFILE"?  I don't think so. I think the value coming out of the CLAMD_CONFIGFILE should be mandatory and authoritative.

Likewise should CLAMD_SOCKET come out of a sysconfig file, or should it always be grepped out of the CLAMD_CONFIGFILE?

In short, EL provides some of the files necessary to allow individually configured instances of clamd to run, but not enough information to do so.

Comment 6 Jan-Frode Myklebust 2011-11-25 21:37:45 UTC
> In short, EL provides some of the files necessary to allow individually
> configured instances of clamd to run, but not enough information to do so.


Did you see /usr/share/clamav/README.clamd-wrapper

Comment 7 Philip Prindeville 2011-11-25 22:08:46 UTC
Hmmm.... on 2nd glance, the whole sequence:

## backward-compatibility check...
for i in /var/run/clamd.${CLAMD_SERVICE}/clamd.sock \
	 /var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do
  CLAMD_SOCKET=$i
  test ! -e "$i" || break
done

can safely be deleted from clamd-wrapper, as it never gets used elsewhere in the script.

Comment 8 Philip Prindeville 2011-11-25 22:10:35 UTC
(In reply to comment #6)
> > In short, EL provides some of the files necessary to allow individually
> > configured instances of clamd to run, but not enough information to do so.
> 
> 
> Did you see /usr/share/clamav/README.clamd-wrapper

Well, yes. And it refers to a non-existent clamd.init and clamd.sysconfig file, which is my point in filing this bug.

Comment 9 Philip Prindeville 2011-11-26 00:08:57 UTC
Created attachment 536484 [details]
Add missing init and sysconfig files; clean up wrapper script

Comment 10 Philip Prindeville 2011-12-06 21:11:50 UTC
Fix has been posted. Can we please get some movement on this?

Comment 11 Fedora Update System 2011-12-14 00:05:48 UTC
clamav-0.97.3-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/clamav-0.97.3-2.el6

Comment 12 Fedora Update System 2011-12-14 00:05:56 UTC
clamav-0.97.3-2.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/clamav-0.97.3-2.el5

Comment 13 Fedora Update System 2011-12-14 20:28:15 UTC
Package clamav-0.97.3-2.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing clamav-0.97.3-2.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2011-5235/clamav-0.97.3-2.el6
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2011-12-30 20:05:14 UTC
clamav-0.97.3-2.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2011-12-30 20:05:31 UTC
clamav-0.97.3-2.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Yuri Arabadji 2012-01-01 20:27:15 UTC
I disagree with this update. It broke logrotate freshclam config:

# rpm -qf /etc/logrotate.d/freshclam 
clamav-db-0.97.3-2.el5
# rpm -qV clamav-db 
# cat /etc/logrotate.d/freshclam
/var/log/clamav/freshclam.log {
        missingok
        notifempty
        create 644 clam clam
}
/var/log/clamav/freshclam.log {
        missingok
        notifempty
        create 644 clam clam
}
# logrotate /etc/logrotate.d/freshclam
error: /etc/logrotate.d/freshclam:6 duplicate log entry for /var/log/clamav/freshclam.log
error: found error in /var/log/clamav/freshclam.log , skipping
#

Thanks.

Comment 17 Robert Scheck 2012-01-01 20:36:21 UTC
I already have fixed this in GIT for EL6 and EL5, but no new build has been
created from that so far, IIRC.

Comment 18 Nick Bebout 2012-01-01 23:31:03 UTC
Reverted these changes, and resolving this bug as WONTFIX.  They are breaking existing installations and no changes appear to be necessary.  Feel free to request a new package to add separate scripts for maintaining multiple clamd installations.  You can maintain your own clamav-wrapper package if you would like.

Comment 19 Jan-Frode Myklebust 2012-01-02 06:54:04 UTC
Great, thanks for reverting and prioritizing stability. Completely agree.

Comment 20 Philip Prindeville 2012-01-02 07:54:36 UTC
(In reply to comment #19)
> Great, thanks for reverting and prioritizing stability. Completely agree.

No one tries to destabilize code.

It happens as an unintended consequence of trying to make code more maintainable, and in this case trying to simplify organization and identify shared parts with different distros.

In this instance, it was a regression introduced by a single-line change that's been corrected.

Comment 21 Jan-Frode Myklebust 2012-01-02 08:13:26 UTC
Philip, of course no one tries to destabilize code, but too much was being fixed or re-organized at the same time here. I did read trough all your patches when you submitted them, couldn't see anything specifically wrong, most changes looked obviously correct, but was very uneasy about changing this much at once in EPEL.


> In this instance, it was a regression introduced by a single-line change that's
> been corrected.

BTW: you did notice bz #771025 too, right ?

Comment 22 Philip Prindeville 2012-04-18 01:43:57 UTC
(In reply to comment #21)
> Philip, of course no one tries to destabilize code, but too much was being
> fixed or re-organized at the same time here. I did read trough all your patches
> when you submitted them, couldn't see anything specifically wrong, most changes
> looked obviously correct, but was very uneasy about changing this much at once
> in EPEL.
> 
> 
> > In this instance, it was a regression introduced by a single-line change that's
> > been corrected.
> 
> BTW: you did notice bz #771025 too, right ?

Yes, and I responded:

https://bugzilla.redhat.com/show_bug.cgi?id=771025#c6


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