Created attachment 232559 [details] This handles the issue The rc.d script has the clamav database path hardcoded into the script. If you change the database path in clamd.conf, the current rc.d script will effectively prevent clamd from running. I've attached my fix, making a new rc.conf variable to define where the database should go. I recognize that it's the same definition in two places (rc.conf and clamd.conf) but at least this version will be less surprising. An obvious improvement is to make the variable the value of DatabaseDirectory in ${PREFIX}/clamd.conf.
I'm pretty sure this affects everyone.
Yes please! Thanks for the patch. I'd suggest naming the config setting clamav_clamd_dbdir or clamav_db_dir. The latter I think is a better choice because rc.d/clamav-freshclam also needs to take the directory location into account as required_dirs.
"An obvious improvement is to make the variable the value of DatabaseDirectory in ${PREFIX}/clamd.conf." Yes, that would be better! And it's easy enough to do: grep -i databasedirectory /data/etc/clamd.conf | awk '{ print $2 }' I'd also like to see a clamav_clamd_conf setting that is passed to clamd as the -c option, so I can specify the path to clamd.conf and then the DB directory is learned from the config file.
Sorry for all the noise. Just thought I point out that the way I'm currently using an alternate directory is with these rc.conf settings: sysrc clamav_clamd_flags="-c /data/etc/clamd.conf" sysrc clamav_freshclam_flags="--config-file=/data/etc/freshclam.conf --datadir=/data/db" And modifying the rc.d/clamav-* files to point at the correct datadir.