Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211397 - app-antivirus/clamav - make nicelevel configurable in initscript
Summary: app-antivirus/clamav - make nicelevel configurable in initscript
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-25 16:22 UTC by Jens Weibler
Modified: 2008-02-29 23:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Weibler 2008-02-25 16:22:55 UTC
A small patch to nice daemons started by /etc/init.d/clamd.
All three daemons typically run in the background and especially clamd uses a lot cpu time.

Reproducible: Always

Steps to Reproduce:




/usr/portage/app-antivirus/clamav/files/clamd.conf:

--- clamd.conf  2005-05-14 23:35:17.000000000 +0200
+++ /etc/conf.d/clamd   2008-02-25 16:57:44.507946937 +0100
@@ -5,3 +5,13 @@

 START_CLAMD=yes
 START_FRESHCLAM=yes
+
+# CLAMD_NICELEVEL let's you set the 'nice'ness of the running
+# clamd process
+
+CLAMD_NICELEVEL=3
+
+# FRESHCLAM_NICELEVEL let's you set the 'nice'ness of the running
+# freshclam process
+
+FRESHCLAM_NICELEVEL=19





/usr/portage/app-antivirus/clamav/files/clamd.rc

--- clamd.rc    2007-04-13 23:05:25.000000000 +0200
+++ /etc/init.d/clamd   2008-02-25 17:15:03.437946937 +0100
@@ -21,6 +21,7 @@
                fi
                ebegin "Starting clamd"
                start-stop-daemon --start --quiet \
+                       --nicelevel ${CLAMD_NICELEVEL:-0} \
                        --exec /usr/sbin/clamd
                eend $? "Failed to start clamd"
        fi
@@ -29,6 +30,7 @@
                ebegin "Starting freshclam"

                start-stop-daemon --start --quiet \
+                       --nicelevel ${FRESHCLAM_NICELEVEL:-0} \
                        --exec /usr/bin/freshclam -- -d
                retcode=$?
                if [ ${retcode} = 1 ]; then
@@ -86,6 +88,7 @@

                ebegin "Starting clamav-milter"
                start-stop-daemon --start --quiet \
+                       --nicelevel ${MILTER_NICELEVEL:-0} \
                        --exec /usr/sbin/clamav-milter -- ${MILTER_OPTS} ${MILTER_SOCKET}
                eend $? "Failed to start clamav-milter"
        fi
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2008-02-25 23:30:40 UTC
Neat idea. I'll get to it hopefully tomorrow after work.
Comment 2 Andrej Kacian (RETIRED) gentoo-dev 2008-02-29 23:49:17 UTC
Changes committed to the tree, thanks!