#! /bin/sh
#
# $NetBSD: milter-manager.sh,v 1.3 2010/05/28 07:40:22 obache Exp $
#

# PROVIDE: milter-manager
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown

. /etc/rc.subr

name="milter_manager"
rcvar=$name
command="/usr/pkg/sbin/milter-manager"
pidfile="/var/run/milter-manager/milter-manager.pid"
command_args="--daemon"
extra_command="reload"

start_precmd="${name}_prestart"

milter_manager_prestart()
{
	if [ ! -d /var/run/milter-manager ]; then
		/bin/mkdir -p /var/run/milter-manager
		/usr/sbin/chown _milter /var/run/milter-manager
		/usr/bin/chgrp _milter /var/run/milter-manager
		/bin/chmod 0755 /var/run/milter-manager
	fi
}

load_rc_config ${name}
run_rc_command "$1"
