summaryrefslogtreecommitdiff
path: root/mail/noattach/files
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
commitae5215e025daae99b3ebfe22cd65310eebbdfc70 (patch)
tree95bc399a7e716d1a06cd630891cabc9b67eedc7b /mail/noattach/files
parentscience/erkale: fix build on GCC architectures (diff)
- cleanup rc.d script
Notes
Notes: svn path=/head/; revision=531850
Diffstat (limited to 'mail/noattach/files')
-rw-r--r--mail/noattach/files/noattach.in26
1 files changed, 15 insertions, 11 deletions
diff --git a/mail/noattach/files/noattach.in b/mail/noattach/files/noattach.in
index ac167c52feca..3e4d40f44818 100644
--- a/mail/noattach/files/noattach.in
+++ b/mail/noattach/files/noattach.in
@@ -19,35 +19,39 @@
#
# 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"
+desc="Noattach Milter Daemon"
rcvar="noattach_enable"
+
+load_rc_config $name
+
+: ${noattach_enable:="NO"}
+: ${noattach_pidfile:="/var/run/noattach.pid"}
+: ${noattach_socket:="/var/run/noattach"}
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"
+pidfile="${noattach_pidfile}"
+command_args="-p local:${noattach_socket} ${noattach_flags}"
-noattach_prestart() {
+noattach_prestart()
+{
/bin/rm -f "${pidfile}" "${noattach_socket}"
}
-noattach_poststop() {
+noattach_poststop()
+{
/bin/rm -f "${pidfile}" "${noattach_socket}"
}
-noattach_reload() {
+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"