diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-04-30 13:58:01 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-04-30 15:13:30 +0000 |
commit | 4cd38832fbf55711e7912b9ea74b3264572c04ea (patch) | |
tree | 8e55a4dc90106213ac7a8eab95ea980d83b5fe5f /main/clamav/clamd.initd | |
parent | 871195d63ce0f2681006c25a3a669906fce92302 (diff) | |
download | aports-4cd38832fbf55711e7912b9ea74b3264572c04ea.tar.bz2 aports-4cd38832fbf55711e7912b9ea74b3264572c04ea.tar.xz |
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
Diffstat (limited to 'main/clamav/clamd.initd')
-rwxr-xr-x[-rw-r--r--] | main/clamav/clamd.initd | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/main/clamav/clamd.initd b/main/clamav/clamd.initd index 0e17010247..10c9c6db16 100644..100755 --- 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 $? } |