Date: Wed, 12 May 2010 17:57:42 -0700 From: Chuck Swiger <cswiger@mac.com> To: Andy Dills <andy@xecu.net> Cc: freebsd-stable@freebsd.org Subject: Re: Why doesn't this startup script execute on boot? Message-ID: <3C6E6C70-756E-407B-97C5-B453138D8294@mac.com> In-Reply-To: <20100512193814.L37652@shell.xecu.net> References: <20100512193814.L37652@shell.xecu.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi--
On May 12, 2010, at 4:46 PM, Andy Dills wrote:
> I'm working on getting p0f integrated with amavisd-new. Everything is
> great, with the exception that I can't get the neccessary commands to
> execute on boot.
The amavid-p0fanalyzer script should have been installed if you used the port:
% cat /usr/local/etc/rc.d/amavis-p0fanalyzer
#!/bin/sh
# $FreeBSD: ports/security/amavisd-new/files/amavis-p0fanalyzer.sh.in,v 1.6 2007/03/30 21:52:10 gabor Exp $
# PROVIDE: amavis_p0fanalyzer
# REQUIRE: DAEMON
# BEFORE: amavisd
amavis_p0fanalyzer_enable="${amavis_p0fanalyzer_enable-NO}"
amavis_p0fanalyzer_p0f_filter="${amavis_p0fanalyzer_p0f_filter-"tcp dst port 25"}"
amavis_p0fanalyzer_pidfile1="${amavis_p0fanalyzer_pidfile1-/var/run/p0fanalyzer1.pid}"
amavis_p0fanalyzer_pidfile2="${amavis_p0fanalyzer_pidfile2-/var/run/p0fanalyzer2.pid}"
amavis_p0f_daemon_flags="${amavis_p0f_daemon_flags--l}"
amavis_p0fanalyzer_flags="${amavis_p0fanalyzer_flags-2345}"
. /etc/rc.subr
name="amavis_p0fanalyzer"
rcvar=`set_rcvar`
start_cmd=p0fanalyzer_start
stop_cmd=p0fanalyzer_stop
p0fanalyzer_start() {
echo "Starting p0f-analyzer." && \
/usr/sbin/daemon -p ${amavis_p0fanalyzer_pidfile1} \
/usr/local/bin/p0f ${amavis_p0f_daemon_flags} \
"${amavis_p0fanalyzer_p0f_filter}" 2>&1 | \
/usr/sbin/daemon -p ${amavis_p0fanalyzer_pidfile2} \
/usr/local/sbin/p0f-analyzer.pl ${amavis_p0fanalyzer_flags}
}
p0fanalyzer_stop() {
/bin/kill `cat ${amavis_p0fanalyzer_pidfile2}` && rm ${amavis_p0fanalyzer_pidfile2}
/bin/kill `cat ${amavis_p0fanalyzer_pidfile1}` && rm ${amavis_p0fanalyzer_pidfile1}
}
load_rc_config $name
run_rc_command "$1"
Regards,
--
-Chuck
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C6E6C70-756E-407B-97C5-B453138D8294>
