summaryrefslogtreecommitdiff
path: root/mail/amavisd-new/files
diff options
context:
space:
mode:
authorkefren <kefren>2010-12-24 07:19:35 +0000
committerkefren <kefren>2010-12-24 07:19:35 +0000
commita1229ae3096a2f8d5c1952c5e6728b11e9a1ac19 (patch)
tree286855ae68dfbdfe995719096e2028de801c1320 /mail/amavisd-new/files
parentf86b4a79860bc33e88f8e7ff75a7b6a6fd1a4b08 (diff)
downloadpkgsrc-a1229ae3096a2f8d5c1952c5e6728b11e9a1ac19.tar.gz
re-add files after conflicting import
Diffstat (limited to 'mail/amavisd-new/files')
-rw-r--r--mail/amavisd-new/files/amavisd.sh77
-rw-r--r--mail/amavisd-new/files/amavismilter.sh57
2 files changed, 134 insertions, 0 deletions
diff --git a/mail/amavisd-new/files/amavisd.sh b/mail/amavisd-new/files/amavisd.sh
new file mode 100644
index 00000000000..1472264b932
--- /dev/null
+++ b/mail/amavisd-new/files/amavisd.sh
@@ -0,0 +1,77 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: amavisd.sh,v 1.3 2010/12/24 07:19:35 kefren Exp $
+#
+# PROVIDE: amavisd
+# REQUIRE: DAEMON
+# BEFORE: mail
+#
+#
+# You will need to set some variables in /etc/rc.conf to start amavisd:
+#
+# amavisd=YES
+#
+# The following variables are optional:
+#
+# amavisd_user="@AMAVIS_USER@" # user to run amavisd as
+# amavisd_group="@AMAVIS_GROUP@" # ${amavisd_user}'s group
+# amavisd_dirs="@AMAVIS_DIR@" # directories that should be created
+# # before starting amavisd
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="amavisd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+command_interpreter="@PERL5@"
+pidfile="@AMAVIS_DIR@/amavisd.pid"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+: ${amavisd_user="@AMAVIS_USER@"}
+: ${amavisd_group="@AMAVIS_GROUP@"}
+: ${amavisd_dirs="@AMAVIS_DIR@ @AMAVIS_DIR@/db @AMAVIS_DIR@/tmp @AMAVIS_QUARANTINE@"}
+
+start_precmd="amavisd_prestart"
+stop_cmd="amavisd_stop"
+
+amavisd_prestart()
+{
+ @RM@ -f @AMAVIS_DIR@/amavisd.sock
+ for dir in ${amavisd_dirs}; do
+ @MKDIR@ $dir
+ @CHOWN@ ${amavisd_user}:${amavisd_group} $dir
+ @CHMOD@ 0750 $dir
+ done
+}
+
+# Net::Server breaks rc.subr's techniques for detecting whether the
+# process running at a certain PID is actually the process we wish to
+# stop. Just unconditionally send SIGTERM to the PID instead.
+#
+amavisd_stop()
+{
+ @ECHO@ "Stopping ${name}."
+ if [ -f ${pidfile} ]; then
+ pid=`@HEAD@ -1 ${pidfile}`
+ doit="@SU@ -m ${amavisd_user} -c \"kill ${pid}\""
+ if ! eval $doit && [ -z "$rc_force" ]; then
+ return 1
+ fi
+ wait_for_pids $pid
+ fi
+ @RM@ -f ${pidfile}
+ for dir in ${amavisd_dirs}; do
+ @RMDIR@ -p $dir 2>/dev/null || @TRUE@
+ done
+}
+
+if [ -f /etc/rc.subr -a -f /etc/rc.conf \
+ -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ @ECHO@ -n " ${name}"
+ eval ${start_precmd}
+ ${command} ${amavisd_flags} ${command_args}
+fi
diff --git a/mail/amavisd-new/files/amavismilter.sh b/mail/amavisd-new/files/amavismilter.sh
new file mode 100644
index 00000000000..064ce299d48
--- /dev/null
+++ b/mail/amavisd-new/files/amavismilter.sh
@@ -0,0 +1,57 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: amavismilter.sh,v 1.3 2010/12/24 07:19:35 kefren Exp $
+#
+# PROVIDE: amavismilter
+# REQUIRE: DAEMON
+# BEFORE: mail
+#
+# To communicate with libmilter through a UNIX domain socket (the
+# socket must exist in a location that's writable by the user named
+# by ${amavismilter_user}:
+#
+# amavismilter_flags="-p local:/path/to/socket"
+#
+# To communicate with libmilter through a TCP/IP socket:
+#
+# amavismilter_flags="-p inet:port@0.0.0.0"
+#
+# To communicate with libmilter through a TCP/IP socket restricted to a
+# particular interface address:
+#
+# amavismilter_flags="-p inet:port@A.B.C.D"
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="amavismilter"
+rcvar=$name
+command="@PREFIX@/sbin/amavis-milter"
+required_vars="amavisd"
+: ${amavismilter_user="@AMAVIS_USER@"}
+: ${amavismilter_flags="-p local:@AMAVIS_DIR@/amavis-milter.sock"}
+
+start_precmd="amavismilter_precmd"
+
+# Before starting amavis-milter, remove the old milter socket if it exists.
+amavismilter_precmd()
+{
+ set -- ${amavismilter_flags}
+ case $2 in
+ local:*)
+ @RM@ -f "${2#local:}"
+ ;;
+ esac
+}
+
+if [ -f /etc/rc.subr -a -f /etc/rc.conf \
+ -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ @ECHO@ -n " ${name}"
+ eval ${start_precmd}
+ ${command} ${amavismilter_flags} ${command_args}
+fi