aboutsummaryrefslogtreecommitdiff
path: root/mail/noattach/files/noattach.in
diff options
context:
space:
mode:
Diffstat (limited to 'mail/noattach/files/noattach.in')
-rw-r--r--mail/noattach/files/noattach.in53
1 files changed, 53 insertions, 0 deletions
diff --git a/mail/noattach/files/noattach.in b/mail/noattach/files/noattach.in
new file mode 100644
index 000000000000..ac167c52feca
--- /dev/null
+++ b/mail/noattach/files/noattach.in
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+# Start or stop noattach
+
+# PROVIDE: noattach
+# REQUIRE: DAEMON
+# BEFORE: mail
+# KEYWORD: shutdown
+#
+
+# Define these noattach_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/noattach
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+# noattach_flags Flags to noattach
+
+noattach_enable=${noattach_enable:-"NO"} # Enable noattach
+noattach_pidfile=${noattach_pidfile:-"/var/run/noattach.pid"} # Path to pidfile
+noattach_socket=${noattach_socket:-"/var/run/noattach"} # Path to socket
+
+. /etc/rc.subr
+
+name="noattach"
+rcvar="noattach_enable"
+command="%%PREFIX%%/libexec/${name}"
+required_files="%%PREFIX%%/etc/noattach.patterns"
+start_precmd="noattach_prestart"
+stop_postcmd="noattach_poststop"
+reload_cmd="noattach_reload"
+extra_commands="reload"
+
+noattach_prestart() {
+ /bin/rm -f "${pidfile}" "${noattach_socket}"
+}
+
+noattach_poststop() {
+ /bin/rm -f "${pidfile}" "${noattach_socket}"
+}
+
+noattach_reload() {
+ kill -USR1 `head -1 "${pidfile}"`
+}
+
+load_rc_config $name
+pidfile="${noattach_pidfile}"
+command_args="-p local:${noattach_socket} ${noattach_flags}"
+
+run_rc_command "$1"