Bug 1195864 - clamd doesn't try to source sysconfig file
Summary: clamd doesn't try to source sysconfig file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: clamav
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Nick Bebout
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-24 17:53 UTC by Joel Smith
Modified: 2015-04-26 19:37 UTC (History)
7 users (show)

Fixed In Version: clamav-0.98.6-2.el5
Clone Of:
Environment:
Last Closed: 2015-04-26 19:37:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch against el6 branch to make init script source /etc/sysconfig/clamd if present (1.25 KB, patch)
2015-02-24 17:53 UTC, Joel Smith
no flags Details | Diff

Description Joel Smith 2015-02-24 17:53:03 UTC
Created attachment 994785 [details]
patch against el6 branch to make init script source /etc/sysconfig/clamd if present

Description of problem:

The clamd init script doesn't try to source the /etc/sysconfig/clamd file, which means that it is difficult to do things like run clamd in a cgroup.  If the clamd init script attempted to source that file, running clamd in a cgroup would be as simple as creating /etc/sysconfig/clamd with the contents:

CGROUP_DAEMON="cpu,cpuacct:/clamav"

(assuming that such a group existed). See https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/Starting_a_Process.html#Starting_a_Service for more information about how this use case is supposed to work.

As things stand today, getting equivalent functionality requires hacks like sysadmins modifying their local init scripts.

This is a duplicate of #756854, but I'd like to revisit the issue since I have an actual use case that is broken and provide a simple, safe patch that won't affect stability (assuming I got it right ;-) ).

Version-Release number of selected component (if applicable):
0.98.6-1.el6

How reproducible:
100%

Steps to Reproduce:

As root:

cat >> /etc/sysconfig/clamd <<EOF
export CLAMD_TEST_ENV_VAR=test
EOF
service clamd restart
strings /proc/$(pgrep clamd)/environ | grep CLAMD_TEST_ENV_VAR

Actual results:
Stopping Clam AntiVirus Daemon:                            [  OK  ]
Starting Clam AntiVirus Daemon:                            [  OK  ]
<nothing>

Expected results:
Stopping Clam AntiVirus Daemon:                            [  OK  ]
Starting Clam AntiVirus Daemon:                            [  OK  ]
CLAMD_TEST_ENV_VAR=test

Additional info:
Patch attached.

Comment 1 Fedora Update System 2015-04-10 17:04:40 UTC
clamav-0.98.6-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/clamav-0.98.6-2.el6

Comment 2 Fedora Update System 2015-04-10 17:07:09 UTC
clamav-0.98.6-2.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/clamav-0.98.6-2.el5

Comment 3 Fedora Update System 2015-04-12 02:44:34 UTC
Package clamav-0.98.6-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.98.6-2.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-5761/clamav-0.98.6-2.el6
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2015-04-26 19:37:14 UTC
clamav-0.98.6-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 5 Fedora Update System 2015-04-26 19:37:22 UTC
clamav-0.98.6-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.


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