Date: Mon, 29 Jun 2009 02:08:31 +0200 (CEST) From: olli hauer <ohauer@gmx.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: ohauer@gmx.de Subject: ports/136151: [patch] port security/amavisd-new add snmp subagent Message-ID: <20090629000831.8C38F2613F@u18-124.dsl.vianetworks.de> Resent-Message-ID: <200906290010.n5T0A4Di097223@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 136151 >Category: ports >Synopsis: [patch] port security/amavisd-new add snmp subagent >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Jun 29 00:10:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: ohauer >Release: FreeBSD 7.2-RELEASE i386 >Organization: >Environment: >Description: amavisd-new has now a snmp-subagent. Since p5-Net-SNMP is required for the agent it is disabled in the default OPTIONS To use this subagent the following line in snmpd.conf is required. master agentx With the following example the values can get via snmpwalk snmpwalk -v $SNMPVER -c $COMMUNITY $HOSTNAME .1.3.6.1.4.1.15312.2.1 For more information see http://www.ijs.si/software/amavisd/release-notes.txt -> NEW FEATURES >How-To-Repeat: >Fix: --- patch_amavisd-new_2009-06-29 begins here --- --- Makefile +++ Makefile @@ -37,8 +37,8 @@ CONFIGURE_WRKSRC= ${WRKSRC}/helper-progs BUILD_WRKSRC= ${WRKSRC}/helper-progs -DOCS= AAAREADME.first INSTALL LDAP.schema LICENSE RELEASE_NOTES \ - README_FILES/README.* README_FILES/screen.css \ +DOCS= AAAREADME.first AMAVIS-MIB.txt INSTALL LDAP.schema LICENSE \ + RELEASE_NOTES README_FILES/README.* README_FILES/screen.css \ README_FILES/amavisd-new-docs.html AMAVISUSER?= vscan @@ -48,6 +48,7 @@ DAEMON?= /usr/sbin/daemon -p OPTIONS= BDB "Use BerkeleyDB for nanny/cache/snmp" on \ + SNMP "Install amavisd snmp subagent" off \ SQLITE "Use SQLite for lookups" off \ MYSQL "Use MySQL for lookups/logging/quarantine" off \ PGSQL "Use PgSQL for lookups/logging/quarantine" off \ @@ -87,10 +88,16 @@ AMAVIS_NOMILTER=${AMAVIS_NOMILTER} \ AMAVIS_NOP0F=${AMAVIS_NOP0F} -.include <bsd.port.pre.mk> +.include <bsd.port.options.mk> USE_RC_SUBR+= amavisd.sh +.if defined(WITH_SNMP) && defined(WITH_BDB) +SUB_LIST+= PERL=${PERL} +USE_RC_SUBR+= amavisd-snmp.sh +RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net-mgmt/p5-Net-SNMP +.endif + .if !defined(WITH_MILTER) || (!exists(/usr/lib/libmilter.a) && !exists(${PREFIX}/lib/libmilter.a)) AMAVIS_NOAMAVIS="@comment " .endif @@ -239,6 +246,8 @@ .endfor @${REINPLACE_CMD} "s|/var/amavis/db|${AMAVISDIR}/db|" ${WRKSRC}/amavisd-agent @${REINPLACE_CMD} "s|/var/amavis/db|${AMAVISDIR}/db|" ${WRKSRC}/amavisd-nanny + @${REINPLACE_CMD} -e "s|/var/amavis/db|${AMAVISDIR}/db|" \ + -e "s|/usr/bin/perl|${PERL}|" ${WRKSRC}/amavisd-snmp-subagent @${REINPLACE_CMD} "s|/var/amavis/amavisd.sock|${AMAVISDIR}/amavisd.sock|" \ ${WRKSRC}/amavisd-release @${REINPLACE_CMD} "s|#define HAVE_MKTEMP|#undef HAVE_MKTEMP|" \ @@ -266,7 +275,7 @@ .if defined(WITH_P0F) ${INSTALL_SCRIPT} ${WRKSRC}/p0f-analyzer.pl ${PREFIX}/sbin .endif -.for i in amavisd amavisd-agent amavisd-nanny amavisd-release +.for i in amavisd amavisd-agent amavisd-nanny amavisd-release amavisd-snmp-subagent ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${PREFIX}/sbin .endfor ${INSTALL_SCRIPT} ${WRKSRC}/amavisd.conf ${PREFIX}/etc/amavisd.conf-dist @@ -295,4 +304,4 @@ ${LN} -s ${PREFIX}/sbin/amavisd-release ${PREFIX}/sbin/amavisd-requeue @${CAT} ${PKGMESSAGE} -.include <bsd.port.post.mk> +.include <bsd.port.mk> --- pkg-plist +++ pkg-plist @@ -1,6 +1,7 @@ @comment $FreeBSD: ports/security/amavisd-new/pkg-plist,v 1.26 2009/06/28 08:53:46 gabor Exp $ @unexec if cmp -s %%PREFIX%%/etc/amavisd-custom.conf %%PREFIX%%/etc/amavisd-custom.conf-dist; then rm %%PREFIX%%/etc/amavisd-custom.conf; fi %%PORTDOCS%%%%DOCSDIR%%/AAAREADME.first +%%PORTDOCS%%%%DOCSDIR%%/AMAVIS-MIB.txt %%PORTDOCS%%%%DOCSDIR%%/INSTALL %%PORTDOCS%%%%DOCSDIR%%/LDAP.schema %%PORTDOCS%%%%DOCSDIR%%/LICENSE @@ -79,3 +80,4 @@ sbin/amavisd-nanny sbin/amavisd-release sbin/amavisd-requeue +sbin/amavisd-snmp-subagent --- files/amavisd-snmp.sh.in +++ files/amavisd-snmp.sh.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: amavisd_snmp +# REQUIRE: snmpd +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable amavisd-snmp-subagent: +# +#amavisd_snmp_enable="YES" +# + +. /etc/rc.subr + +name=amavisd_snmp +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/amavisd-snmp-subagent" +command_interpreter="%%PERL%%" +pidfile="%%AMAVISDIR%%/amavisd-snmp.pid" + +# defaults +amavisd_snmp_enable=${amavisd_snmp_enable:-"NO"} +# amavis database directory +amavisd_snmp_dbdir=${amavisd_snmp_dbdir:-"%%AMAVISDIR%%/db"} +# log_level 0..5, default 0 +amavisd_snmp_loglevel=${amavisd_snmp_loglevel:-"0"} + +load_rc_config $name + +required_dirs=${amavisd_snmp_dbdir} +amavisd_snmp_flags="-D ${amavisd_snmp_dbdir} -d ${amavisd_snmp_loglevel} -P ${pidfile}" +run_rc_command "$1" --- patch_amavisd-new_2009-06-29 ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090629000831.8C38F2613F>