1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00
freebsd-ports/mail/opensmtpd-devel/files/smtpd.in
Ashish SHUKLA 5a2ce98c64 - Make rc.d script sends signals only to the parent daemon process to
fix a race condition.

Submitted by:	naddy (via private email)
2014-06-04 00:32:31 +00:00

41 lines
865 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: smtpd mail
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable smtpd:
# smtpd_enable (bool): Set it to "YES" to enable OpenSMTPD.
# Default is "NO".
# smtpd_config (string): Path to OpenSMTPD configuration file.
# Default is "%%PREFIX%%/etc/mail/smtpd.conf"
# smtpd_flags (string): Additional flags to be passed to smtpd.
# Default is "".
#
#
. /etc/rc.subr
check_process()
{
/bin/pgrep -f 'smtpd: \[priv\]'
}
name="smtpd"
rcvar=smtpd_enable
load_rc_config $name
: ${smtpd_enable:="NO"}
: ${smtpd_config:="%%PREFIX%%/etc/mail/smtpd.conf"}
: ${smtpd_procname:="%%PREFIX%%/sbin/smtpd"}
: ${smtpd_flags:=""}
command=${smtpd_procname}
procname=${smtpd_procname}
run_rc_command "$1"