From 4cd38832fbf55711e7912b9ea74b3264572c04ea Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 30 Apr 2012 13:58:01 +0000 Subject: main/clamav: separate clamav-db and freshclam Having a big static db in a package is not a good idea for /var on disk installs. We ship the db and freshclam in separate packages. also clean up the install and init.d scripts while here. fixes #1047 --- main/clamav/clamd.initd | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) mode change 100644 => 100755 main/clamav/clamd.initd (limited to 'main/clamav/clamd.initd') diff --git a/main/clamav/clamd.initd b/main/clamav/clamd.initd old mode 100644 new mode 100755 index 0e17010247..10c9c6db16 --- a/main/clamav/clamd.initd +++ b/main/clamav/clamd.initd @@ -20,6 +20,24 @@ start() { if [ -S "${clamd_socket:=/tmp/clamd}" ]; then rm -f ${clamd_socket} fi + + local dbdir=$(awk '$1 == "DatabaseDirectory" { print $2 }' $CONF) + local timout=${FRESHCLAM_TIMEOUT:-120} + local cvd="${dbdir:-/var/lib/clamav}"/main.cvd + + if ! [ -e "$cvd" ]; then + ebegin "Waiting for clamav database download" + while ! [ -e "$cvd" ]; do + timeout=$(( $timeout - 1 )) + if [ $timeout -eq 0 ]; then + eend 1 "Timed out" + return 1 + fi + sleep 1 + done + eend 0 + fi + ebegin "Starting ${NAME}" start-stop-daemon --start --quiet \ --nicelevel ${CLAMD_NICELEVEL:-0} \ @@ -39,7 +57,7 @@ reload() { eend 1 "${NAME} is not started" return 1 fi - start-stop-daemon --stop --oknodo --signal HUP \ + start-stop-daemon --stop --signal HUP \ --exec /usr/sbin/clamd eend $? } -- cgit v1.2.3