#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

command="/usr/local/sbin/vrfydmn"
PIDDIR="/run/${SVCNAME}"
PIDFILE="${PIDDIR}/${SVCNAME}.pid"

depend() {
	use mta logger net
}

start() {
	if [ ! -d  "${PIDDIR}" ] ; then
		checkpath -q -d -o milter:milter -m 0755 "${PIDDIR}" || return 1
	fi

        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --pidfile "${PIDFILE}" \
                --exec ${command} -- -p "${PIDFILE}" ${OPTIONS}
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --pidfile "${PIDFILE}" \
		--retry 30 \
                --exec ${command}
        eend $?
}

