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/freshclam.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/freshclam.initd')
-rw-r--r-- | main/clamav/freshclam.initd | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/main/clamav/freshclam.initd b/main/clamav/freshclam.initd index 2efd2e48d7..be8aa16e49 100644 --- a/main/clamav/freshclam.initd +++ b/main/clamav/freshclam.initd @@ -3,8 +3,8 @@ extra_started_commands="reload" extra_commands="logfix" -NAME=freshclam -DAEMON=/usr/bin/$NAME +command=/usr/bin/freshclam +pidfile=/var/run/clamav/freshclam.pid CONF=/etc/clamav/freshclam.conf depend() { @@ -16,30 +16,23 @@ start() { ebegin "Starting freshclam" start-stop-daemon --start --quiet \ --nicelevel ${FRESHCLAM_NICELEVEL:-0} \ - --exec /usr/bin/freshclam -- -d - retcode=$? - if [ ${retcode} = 1 ]; then - eend 0 - einfo "Virus databases are already up to date." - else - eend ${retcode} "Failed to start freshclam" - fi + --exec $command \ + -- \ + --daemon \ + --pid=$pidfile + eend $? } stop() { - ebegin "Stopping ${NAME}" - start-stop-daemon --stop --quiet --name ${NAME} + ebegin "Stopping freshclam" + start-stop-daemon --stop --quiet --pidfile $pidfile eend $? } reload() { - ebegin "Reloading ${NAME}" - if ! service_started "${NAME}" ; then - eend 1 "${NAME} is not started" - return 1 - fi - start-stop-daemon --stop --oknodo --signal HUP \ - --exec ${DAEMON} --name $NAME + ebegin "Reloading freshclam" + start-stop-daemon --stop --signal HUP \ + --exec $command --pidfile $pidfile eend $? } |