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
Neat idea. I'll get to it hopefully tomorrow after work.
Changes committed to the tree, thanks!