Improved config parsing from within the initscript, thanks to Georgi Georgiev <chutz...
authorAndrej Kacian <ticho@gentoo.org>
Thu, 29 Sep 2005 11:54:42 +0000 (11:54 +0000)
committerAndrej Kacian <ticho@gentoo.org>
Thu, 29 Sep 2005 11:54:42 +0000 (11:54 +0000)
Package-Manager: portage-2.0.52-r1

app-antivirus/clamav/ChangeLog
app-antivirus/clamav/Manifest
app-antivirus/clamav/clamav-0.86.2.ebuild
app-antivirus/clamav/files/clamd.rc
app-antivirus/clamav/files/clamd.rc.new

index 3226bb8c07f89ac2968f7c206c6ef0d71bdf5e09..0b9e30eccf380775481f9d8277454f74540c5741 100644 (file)
@@ -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)
index 31cc3a95df4e6d73639f76b7b56ba90490579093..cb5f3b1db0c790c87910bf4c48803f7257aab554 100644 (file)
@@ -1,10 +1,20 @@
-MD5 d9daaf11e516ab49d99e98fac4bf4dc4 ChangeLog 19924
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
 MD5 83a63937082d0c3288058b7b3246db19 clamav-0.87.ebuild 3689
+MD5 61c732b815d6224b12e0ce8d9b61278f clamav-0.86.2.ebuild 3685
+MD5 111ba2a6d65610580fe41b2dddec3988 ChangeLog 20146
 MD5 7e32edfd72887a57b16ecd73f0f7a1a0 metadata.xml 184
-MD5 0a6b99afacc591544e87d3e8bf8d7c93 clamav-0.86.2.ebuild 3689
 MD5 08f7b320461c04bbb88555e389c2e544 files/clamav-milter.README.gentoo 1124
-MD5 e29ee77ca9bfe28ed18dbf67a9c90e75 files/clamd.conf 193
-MD5 1b3268d3723e003ad99bf706e6bf4312 files/clamd.rc 1444
-MD5 f6bf5b894e60e8686cb5a36ba240e1ef files/clamd.rc.new 2032
-MD5 17e487f0452933ea8ab559a404329cf2 files/digest-clamav-0.87 64
 MD5 8365b1166d97452566de3f0f5140ab43 files/digest-clamav-0.86.2 66
+MD5 17e487f0452933ea8ab559a404329cf2 files/digest-clamav-0.87 64
+MD5 9b6f44bf151d0091e67a26007bf08255 files/clamd.rc.new 2037
+MD5 e29ee77ca9bfe28ed18dbf67a9c90e75 files/clamd.conf 193
+MD5 57ccf69fd65dfbb62e50aa0b27b29754 files/clamd.rc 2028
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDO9YdQlM6RnzZP+IRAvs2AJ0bCT2thV12zMTZSBaAz1LEJdCTwQCeKgsr
+rLGDpp7qLKA32ibi38XhdT4=
+=S+9v
+-----END PGP SIGNATURE-----
index 25703fc02b11c4685c4c78bc9694524d0cd6e085..a2b01c1ad31f867fd66feece6495bee3f92c10b3 100644 (file)
@@ -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
index dc0f3b94e9a3af6164d7a40e20eaced0587fe825..305626ff7d97d3441a30651f3c14ee2f5b58c209 100644 (file)
@@ -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
 }
index a7293710b583be2f5f229f665751066363704407..ab8994f63d61811ce3ac01de61f1fbc52849fb83 100644 (file)
@@ -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}