Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Oct 2012 13:57:13 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r306550 - in head/security/amavisd-new: . files
Message-ID:  <201210281357.q9SDvDRG021237@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sun Oct 28 13:57:12 2012
New Revision: 306550
URL: http://svn.freebsd.org/changeset/ports/306550

Log:
  RC fixes;
  
  - Use REQUIRE in lieu of BEFORE where possible
  - Include KEYWORD: shutdown for persistent services
  - load_rc_config should precede any default settings
  - Style fixes, indenting functions, remove single-line functions
  
  Approved by:	gabor (maintainer)
  Feature safe:	yes

Modified:
  head/security/amavisd-new/Makefile
  head/security/amavisd-new/files/amavis-milter.in
  head/security/amavisd-new/files/amavis-p0fanalyzer.in
  head/security/amavisd-new/files/amavisd-snmp.in
  head/security/amavisd-new/files/amavisd.in

Modified: head/security/amavisd-new/Makefile
==============================================================================
--- head/security/amavisd-new/Makefile	Sun Oct 28 12:12:51 2012	(r306549)
+++ head/security/amavisd-new/Makefile	Sun Oct 28 13:57:12 2012	(r306550)
@@ -2,7 +2,7 @@
 
 PORTNAME=	amavisd-new
 PORTVERSION=	2.8.0
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.ijs.si/software/amavisd/ \

Modified: head/security/amavisd-new/files/amavis-milter.in
==============================================================================
--- head/security/amavisd-new/files/amavis-milter.in	Sun Oct 28 12:12:51 2012	(r306549)
+++ head/security/amavisd-new/files/amavis-milter.in	Sun Oct 28 13:57:12 2012	(r306550)
@@ -2,16 +2,14 @@
 #
 # $FreeBSD$
 #
-
 # PROVIDE: amavis_milter
 # REQUIRE: amavisd
 # BEFORE: mail
 # KEYWORD: shutdown
-
 #
 # Add the following lines to /etc/rc.conf to enable amavis-milter:
 #
-#amavis_milter_enable="YES"
+# amavis_milter_enable="YES"
 #
 
 . /etc/rc.subr
@@ -19,14 +17,13 @@
 name=amavis_milter
 rcvar=amavis_milter_enable
 
-command=%%PREFIX%%/sbin/amavis-milter
-required_files=%%PREFIX%%/etc/amavisd.conf
+load_rc_config $name
 
-# set defaults
+: ${amavis_milter_enable:=NO}
+: ${amavis_milter_flags=-D -p %%AMAVISDIR%%/amavis-milter.sock}
+: ${amavis_milter_user=%%AMAVISUSER%%}
 
-amavis_milter_enable=${amavis_milter_enable:-"NO"}
-amavis_milter_flags=${amavis_milter_flags:-"-D -p %%AMAVISDIR%%/amavis-milter.sock"}
-amavis_milter_user=${amavis_milter_user:-"%%AMAVISUSER%%"}
+command=%%PREFIX%%/sbin/amavis-milter
+required_files=%%PREFIX%%/etc/amavisd.conf
 
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1

Modified: head/security/amavisd-new/files/amavis-p0fanalyzer.in
==============================================================================
--- head/security/amavisd-new/files/amavis-p0fanalyzer.in	Sun Oct 28 12:12:51 2012	(r306549)
+++ head/security/amavisd-new/files/amavis-p0fanalyzer.in	Sun Oct 28 13:57:12 2012	(r306550)
@@ -1,25 +1,28 @@
 #!/bin/sh
 # $FreeBSD$
-
+#
 # PROVIDE: amavis_p0fanalyzer
 # REQUIRE: DAEMON
-# BEFORE: amavisd
-
-amavis_p0fanalyzer_enable="${amavis_p0fanalyzer_enable-NO}"
-amavis_p0fanalyzer_p0f_filter="${amavis_p0fanalyzer_p0f_filter-"tcp dst port 25"}"
-amavis_p0fanalyzer_pidfile1="${amavis_p0fanalyzer_pidfile1-/var/run/p0fanalyzer1.pid}"
-amavis_p0fanalyzer_pidfile2="${amavis_p0fanalyzer_pidfile2-/var/run/p0fanalyzer2.pid}"
-amavis_p0fanalyzer_flags="${amavis_p0fanalyzer_flags-2345}"
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 
-name="amavis_p0fanalyzer"
+name=amavis_p0fanalyzer
 rcvar=amavis_p0fanalyzer_enable
 
+load_rc_config $name
+
+: ${amavis_p0fanalyzer_enable:=no}
+: ${amavis_p0fanalyzer_p0f_filter:=tcp dst port 25}
+: ${amavis_p0fanalyzer_pidfile1=/var/run/p0fanalyzer1.pid}
+: ${amavis_p0fanalyzer_pidfile2=/var/run/p0fanalyzer2.pid}
+: ${amavis_p0fanalyzer_flags=2345}
+
 start_cmd=p0fanalyzer_start
 stop_cmd=p0fanalyzer_stop
 
-p0fanalyzer_start() {
+p0fanalyzer_start()
+{
 	echo "Starting p0f-analyzer." && \
 	  %%DAEMON%% ${amavis_p0fanalyzer_pidfile1} \
 	  %%PREFIX%%/bin/p0f "${amavis_p0fanalyzer_p0f_filter}" 2>&1 | \
@@ -27,10 +30,10 @@ p0fanalyzer_start() {
 	  %%PREFIX%%/sbin/p0f-analyzer.pl ${amavis_p0fanalyzer_flags}
 }
 
-p0fanalyzer_stop() {
+p0fanalyzer_stop()
+{
 	/bin/kill `cat ${amavis_p0fanalyzer_pidfile2}` && rm ${amavis_p0fanalyzer_pidfile2}
 	/bin/kill `cat ${amavis_p0fanalyzer_pidfile1}` && rm ${amavis_p0fanalyzer_pidfile1}
 }
 
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1

Modified: head/security/amavisd-new/files/amavisd-snmp.in
==============================================================================
--- head/security/amavisd-new/files/amavisd-snmp.in	Sun Oct 28 12:12:51 2012	(r306549)
+++ head/security/amavisd-new/files/amavisd-snmp.in	Sun Oct 28 13:57:12 2012	(r306550)
@@ -2,11 +2,9 @@
 #
 # $FreeBSD$
 #
-
 # PROVIDE: amavisd_snmp
 # REQUIRE: snmpd
 # KEYWORD: shutdown
-
 #
 # Add the following lines to /etc/rc.conf to enable amavisd-snmp-subagent:
 #
@@ -18,19 +16,19 @@
 name=amavisd_snmp
 rcvar=amavisd_snmp_enable
 
-command="%%PREFIX%%/sbin/amavisd-snmp-subagent"
-command_interpreter="%%PERL%%"
-pidfile="%%AMAVISDIR%%/amavisd-snmp.pid"
+load_rc_config $name
 
 # defaults
-amavisd_snmp_enable=${amavisd_snmp_enable:-"NO"}
-# amavis database directory
-amavisd_snmp_dbdir=${amavisd_snmp_dbdir:-"%%AMAVISDIR%%/db"}
+: ${amavisd_snmp_enable:=NO}
+: ${amavisd_snmp_dbdir=%%AMAVISDIR%%/db}
 # log_level 0..5, default 0
-amavisd_snmp_loglevel=${amavisd_snmp_loglevel:-"0"}
+: ${amavisd_snmp_loglevel=0}
 
-load_rc_config $name
+command=%%PREFIX%%/sbin/amavisd-snmp-subagent
+command_interpreter=%%PERL%%
+pidfile=${amavisd_pidfile:-%%AMAVISDIR%%/amavisd-snmp.pid}
 
 required_dirs=${amavisd_snmp_dbdir}
 amavisd_snmp_flags="-D ${amavisd_snmp_dbdir} -d ${amavisd_snmp_loglevel} -P ${pidfile}"
-run_rc_command "$1"
+
+run_rc_command $1

Modified: head/security/amavisd-new/files/amavisd.in
==============================================================================
--- head/security/amavisd-new/files/amavisd.in	Sun Oct 28 12:12:51 2012	(r306549)
+++ head/security/amavisd-new/files/amavisd.in	Sun Oct 28 13:57:12 2012	(r306550)
@@ -2,16 +2,14 @@
 #
 # $FreeBSD$
 #
-
 # PROVIDE: amavisd
-# REQUIRE: LOGIN mysql postgresql
+# REQUIRE: LOGIN mysql postgresql amavis_p0fanalyzer
 # BEFORE: mail
 # KEYWORD: shutdown
-
 #
 # Add the following lines to /etc/rc.conf to enable amavisd:
 #
-#amavisd_enable="YES"
+# amavisd_enable="YES"
 #
 
 . /etc/rc.subr
@@ -19,47 +17,36 @@
 name=amavisd
 rcvar=amavisd_enable
 
+load_rc_config $name
+
+: ${amavisd_enable:=NO}
+pidfile=${amavisd_pidfile-"%%AMAVISDIR%%/amavisd.pid"}
+
 command=%%PREFIX%%/sbin/amavisd
 command_args='> /dev/null 2>&1'
 required_files=%%PREFIX%%/etc/amavisd.conf
-extra_commands="reload"
+extra_commands=reload
 
 start_precmd=start_precmd
+stop_postcmd="rm -f $pidfile"
+reload_cmd="$command reload"
+
 
 # possible values include: amavisd_ram="512m"
 # adds ram disk for amavisd defanging/decoding, speeds up large systems 10%
 start_precmd()
 {
-rm -rf %%AMAVISDIR%%/tmp/* %%AMAVISDIR%%/tmp/.* 2>/dev/null || true
-if [ ${amavisd_ram} ];then
-  echo "========================================================"
-  echo "WARNING: using ramdisk is reported to be unstable and"
-  echo "thus it is highly recommended to be turned off."
-  echo "========================================================"
-  df %%AMAVISDIR%%/tmp | grep -E '^(/dev/md|tmpfs)' > /dev/null
-  if [ $? -eq 1 ]; then
-    mdmfs -s ${amavisd_ram} -p 750 -w %%AMAVISUSER%%:%%AMAVISGROUP%% md %%AMAVISDIR%%/tmp || true
-  fi
-fi
-}
-stop_postcmd=stop_postcmd
-
-stop_postcmd()
-{
-  rm -f $pidfile
-}
-
-reload_cmd=${name}_reload
-
-amavisd_reload()
-{
-  ${command} reload
+	rm -rf %%AMAVISDIR%%/tmp/* %%AMAVISDIR%%/tmp/.* 2>/dev/null || true
+	if [ ${amavisd_ram} ];then
+	  echo "========================================================"
+	  echo "WARNING: using ramdisk is reported to be unstable and"
+	  echo "thus it is highly recommended to be turned off."
+	  echo "========================================================"
+	  df %%AMAVISDIR%%/tmp | grep -E '^(/dev/md|tmpfs)' > /dev/null
+	  if [ $? -eq 1 ]; then
+	    mdmfs -s ${amavisd_ram} -p 750 -w %%AMAVISUSER%%:%%AMAVISGROUP%% md %%AMAVISDIR%%/tmp || true
+	  fi
+	fi
 }
 
-# set defaults
-
-amavisd_enable=${amavisd_enable:-"NO"}
-amavisd_pidfile=${amavisd_pidfile:-"%%AMAVISDIR%%/amavisd.pid"}
-
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210281357.q9SDvDRG021237>