diff options
author | Andrej Kacian <ticho@gentoo.org> | 2005-09-29 11:54:42 +0000 |
---|---|---|
committer | Andrej Kacian <ticho@gentoo.org> | 2005-09-29 11:54:42 +0000 |
commit | 4b13ca90eaa86f948058f9d7fb7c8bd5db306a13 (patch) | |
tree | 94455745d4cae118e7420a6d73961604533106f9 /app-antivirus/clamav | |
parent | Version bump. (diff) | |
download | gentoo-2-4b13ca90eaa86f948058f9d7fb7c8bd5db306a13.tar.gz gentoo-2-4b13ca90eaa86f948058f9d7fb7c8bd5db306a13.tar.bz2 gentoo-2-4b13ca90eaa86f948058f9d7fb7c8bd5db306a13.zip |
Improved config parsing from within the initscript, thanks to Georgi Georgiev <chutz at gg3.net>, bug #107362.
(Portage version: 2.0.52-r1)
Diffstat (limited to 'app-antivirus/clamav')
-rw-r--r-- | app-antivirus/clamav/ChangeLog | 7 | ||||
-rw-r--r-- | app-antivirus/clamav/clamav-0.86.2.ebuild | 4 | ||||
-rw-r--r-- | app-antivirus/clamav/files/clamd.rc | 57 | ||||
-rw-r--r-- | app-antivirus/clamav/files/clamd.rc.new | 8 |
4 files changed, 50 insertions, 26 deletions
diff --git a/app-antivirus/clamav/ChangeLog b/app-antivirus/clamav/ChangeLog index 3226bb8c07f8..0b9e30eccf38 100644 --- a/app-antivirus/clamav/ChangeLog +++ b/app-antivirus/clamav/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for app-antivirus/clamav # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/ChangeLog,v 1.112 2005/09/18 07:07:04 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/ChangeLog,v 1.113 2005/09/29 11:54:42 ticho Exp $ + + 29 Sep 2005; Andrej Kacian <ticho@gentoo.org> files/clamd.rc, + files/clamd.rc.new, clamav-0.86.2.ebuild: + Improved config parsing from within the initscript, thanks to Georgi + Georgiev <chutz at gg3.net>, bug #107362. 18 Sep 2005; Markus Rothe <corsair@gentoo.org> clamav-0.87.ebuild: Stable on ppc64 (bug #106279) diff --git a/app-antivirus/clamav/clamav-0.86.2.ebuild b/app-antivirus/clamav/clamav-0.86.2.ebuild index 25703fc02b11..a2b01c1ad31f 100644 --- a/app-antivirus/clamav/clamav-0.86.2.ebuild +++ b/app-antivirus/clamav/clamav-0.86.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.86.2.ebuild,v 1.12 2005/09/16 12:53:30 lcars Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.86.2.ebuild,v 1.13 2005/09/29 11:54:42 ticho Exp $ inherit eutils flag-o-matic fixheadtails @@ -63,7 +63,7 @@ src_install() { make DESTDIR=${D} install || die dodoc AUTHORS BUGS NEWS README ChangeLog FAQ INSTALL newconfd ${FILESDIR}/clamd.conf clamd - newinitd ${FILESDIR}/clamd.rc.new clamd + newinitd ${FILESDIR}/clamd.rc clamd dodoc ${FILESDIR}/clamav-milter.README.gentoo dodir /var/run/clamav diff --git a/app-antivirus/clamav/files/clamd.rc b/app-antivirus/clamav/files/clamd.rc index dc0f3b94e9a3..305626ff7d97 100644 --- a/app-antivirus/clamav/files/clamd.rc +++ b/app-antivirus/clamav/files/clamd.rc @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc,v 1.6 2005/01/27 08:39:02 ticho Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc,v 1.7 2005/09/29 11:54:42 ticho Exp $ depend() { use net @@ -9,32 +9,46 @@ depend() { } start() { + local clamd_socket=`grep ^LocalSocket /etc/clamd.conf | cut -d\ -f 2` if [ "${START_CLAMD}" = "yes" ]; then - if [ -S "/tmp/clamd" ]; then - rm -f /tmp/clamd - fi - if [ -n "${CLAMD_LOG}" -a ! -f "${CLAMD_LOG}" ]; then - touch "${CLAMD_LOG}" - chown clamav:clamav "${CLAMD_LOG}" - CLAMD_OPTS="${CLAMD_OPTS}${CLAMD_LOG}" + if [ -S "${clamd_socket:-/tmp/clamd}" ]; then + rm -f ${clamd_socket:-/tmp/clamd} fi ebegin "Starting clamd" start-stop-daemon --start --quiet \ - --exec /usr/sbin/clamd -- ${CLAMD_OPTS} + --exec /usr/sbin/clamd eend $? "Failed to start clamd" fi if [ "${START_FRESHCLAM}" = "yes" ]; then - if [ -n "${FRESHCLAM_LOG}" ]; then - if [ ! -f "${FRESHCLAM_LOG}" ]; then - touch "${FRESHCLAM_LOG}" - chown clamav:clamav "${FRESHCLAM_LOG}" - fi - FRESHCLAM_OPTS="${FRESHCLAM_OPTS} -l ${FRESHCLAM_LOG}" - fi ebegin "Starting freshclam" start-stop-daemon --start --quiet \ - --exec /usr/bin/freshclam -- ${FRESHCLAM_OPTS} - eend $? "Failed to start freshclam" + --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 + fi + if [ "${START_MILTER}" = "yes" ]; then + if [ -S "${MILTER_SOCKET}" ]; then + rm -f ${MILTER_SOCKET} + fi + + local logfile=`grep -e "^LogFile" /etc/clamd.conf | cut -d\ -f 2` + local clamav_user=`grep -e "^User" /etc/clamd.conf | cut -d\ -f 2` + if [[ -n "${logfile}" && -n "${clamav_user}" ]]; then + if [ ! -f "${logfile}" ]; then + touch ${logfile} + fi + chown ${clamav_user} ${logfile} + fi + + ebegin "Starting clamav-milter" + start-stop-daemon --start --quiet \ + --exec /usr/sbin/clamav-milter -- ${MILTER_OPTS} ${MILTER_SOCKET} + eend $? "Failed to start clamav-milter" fi } @@ -49,4 +63,9 @@ stop() { start-stop-daemon --stop --quiet --name freshclam eend $? "Failed to stop freshclam" fi + if [ "${START_MILTER}" = "yes" ]; then + ebegin "Stopping clamav-milter" + start-stop-daemon --stop --quiet --name clamav-milter + eend $? "Failed to stop clamav-milter" + fi } diff --git a/app-antivirus/clamav/files/clamd.rc.new b/app-antivirus/clamav/files/clamd.rc.new index a7293710b583..ab8994f63d61 100644 --- a/app-antivirus/clamav/files/clamd.rc.new +++ b/app-antivirus/clamav/files/clamd.rc.new @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc.new,v 1.3 2005/05/24 02:01:36 ticho Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc.new,v 1.4 2005/09/29 11:54:42 ticho Exp $ depend() { use net @@ -9,7 +9,7 @@ depend() { } start() { - local clamd_socket=`grep ^LocalSocket /etc/clamd.conf | cut -d\ -f 2` + local clamd_socket=`awk '$1 == "LocalSocket" { print $2 }' /etc/clamd.conf` if [ "${START_CLAMD}" = "yes" ]; then if [ -S "${clamd_socket:-/tmp/clamd}" ]; then rm -f ${clamd_socket:-/tmp/clamd} @@ -36,8 +36,8 @@ start() { rm -f ${MILTER_SOCKET} fi - local logfile=`grep -e "^LogFile" /etc/clamd.conf | cut -d\ -f 2` - local clamav_user=`grep -e "^User" /etc/clamd.conf | cut -d\ -f 2` + local logfile=`awk '$1 == "LogFile" { print $2 }' /etc/clamd.conf` + local clamav_user=`awk '$1 == "User" { print $2 }' /etc/clamd.conf` if [[ -n "${logfile}" && -n "${clamav_user}" ]]; then if [ ! -f "${logfile}" ]; then touch ${logfile} |