aboutsummaryrefslogtreecommitdiffstats
path: root/security/amavisd-new/files/amavisd.in
diff options
context:
space:
mode:
Diffstat (limited to 'security/amavisd-new/files/amavisd.in')
-rw-r--r--security/amavisd-new/files/amavisd.in64
1 files changed, 64 insertions, 0 deletions
diff --git a/security/amavisd-new/files/amavisd.in b/security/amavisd-new/files/amavisd.in
new file mode 100644
index 000000000000..593d26982d81
--- /dev/null
+++ b/security/amavisd-new/files/amavisd.in
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: amavisd
+# REQUIRE: LOGIN mysql postgresql
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable amavisd:
+#
+#amavisd_enable="YES"
+#
+
+. /etc/rc.subr
+
+name=amavisd
+rcvar=amavisd_enable
+
+command=%%PREFIX%%/sbin/amavisd > /dev/null 2>&1
+required_files=%%PREFIX%%/etc/amavisd.conf
+extra_commands="reload"
+
+start_precmd=start_precmd
+
+# 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 '^/dev/md' > /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
+}
+
+# set defaults
+
+amavisd_enable=${amavisd_enable:-"NO"}
+amavisd_pidfile=${amavisd_pidfile:-"%%AMAVISDIR%%/amavisd.pid"}
+
+load_rc_config $name
+run_rc_command "$1"