#!/bin/sh # $FreeBSD: head/mail/noattach/files/noattach.in 340872 2014-01-24 00:14:07Z mat $ # 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"