clamav: Move database directory to /var partition

The clamav database is quite large and occupies valuable
space on the root partition that on older systems is only
2GB large. This change moves the virus definition database
to the /var partition which is larger and supposed to hold
data like this anyway.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2018-10-29 11:25:24 +00:00
parent 2f1d27e3d8
commit aeefbca730
4 changed files with 15 additions and 12 deletions

View File

@@ -27,7 +27,6 @@ usr/lib/libclamunrar_iface.so.7.1.1
#usr/lib/pkgconfig/libclamav.pc
#usr/lib/pkgconfig/libclammspack.pc
usr/sbin/clamd
usr/share/clamav
#usr/share/man/man1/clambc.1
#usr/share/man/man1/clamconf.1
#usr/share/man/man1/clamdscan.1
@@ -45,5 +44,6 @@ var/ipfire/clamav/clamd.conf
var/ipfire/clamav/clamd.conf.sample
var/ipfire/clamav/freshclam.conf
var/ipfire/clamav/freshclam.conf.sample
var/lib/clamav
etc/rc.d/init.d/clamav
usr/local/bin/clamavctrl

View File

@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = clamav
PAK_VER = 40
PAK_VER = 41
DEPS = ""
@@ -40,6 +40,8 @@ ifeq "$(BUILD_PLATFORM)" "arm"
CONFIGURE_FLAGS = --disable-fanotify
endif
DATABASE_DIR = /var/lib/clamav
###############################################################################
# Top-level Rules
###############################################################################
@@ -84,13 +86,14 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && ./configure \
--prefix=/usr \
--sysconfdir=/var/ipfire/clamav \
--with-dbdir=$(DATABASE_DIR) \
$(CONFIGURE_FLAGS)
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
mkdir -p /usr/share/clamav/
chown clamav.clamav -R /usr/share/clamav/
mkdir -pv $(DATABASE_DIR)
chown clamav.clamav -R $(DATABASE_DIR)
rm -rfv $(DATABASE_DIR)/*.cvd
cp -rf $(DIR_SRC)/config/clamav/* /var/ipfire/clamav/
rm -rfv /usr/share/clamav/*.cvd
mkdir -p /var/run/clamav
chown clamav:clamav /var/run/clamav
#install initscripts

View File

@@ -12,12 +12,12 @@ case "$1" in
COUNTER=0
while [ "$COUNTER" -lt "61" ]; do
[ -e "/usr/share/clamav/main.cvd" ] && \
[ -e "/usr/share/clamav/daily.cvd" ] || \
[ -e "/usr/share/clamav/daily.cld" ] && \
[ -e "/var/lib/clamav/main.cvd" ] && \
[ -e "/var/lib/clamav/daily.cvd" ] || \
[ -e "/var/lib/clamav/daily.cld" ] && \
break
if [ "$COUNTER" -lt "1" ]; then
boot_mesg -n "Download db "
boot_mesg -n "Downloading database"
else
boot_mesg -n "."
fi
@@ -46,7 +46,7 @@ case "$1" in
stop)
boot_mesg "Stopping Clamav Definition Updater..."
killproc /usr/bin/freshclam
rm -rf /usr/share/clamav/*.tmp
rm -rf /var/lib/clamav/*.tmp
boot_mesg "Stopping Clamav Daemon..."
killproc /usr/sbin/clamd

View File

@@ -22,7 +22,7 @@
############################################################################
#
. /opt/pakfire/lib/functions.sh
mv /usr/share/clamav /usr/share/clamav-update
mv /var/lib/clamav /var/lib/clamav-update
./uninstall.sh
mv /usr/share/clamav-update /usr/share/clamav
mv /var/lib/clamav-update /var/lib/clamav
./install.sh