Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2010 00:58:40 +0400
From:      Yuri Pankov <yuri.pankov@gmail.com>
To:        Andy Dills <andy@xecu.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Why doesn't this startup script run?
Message-ID:  <20100512205840.GA1878@darklight.org.ru>
In-Reply-To: <20100512161505.H37652@shell.xecu.net>
References:  <20100512161505.H37652@shell.xecu.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 12, 2010 at 04:20:12PM -0400, Andy Dills wrote:
> 
> I'm working on integrating p0f with amavisd-new, and the command I need 
> to run at startup is a little unwieldy:
> 
> p0f -l 'tcp dst port 25' 2>&1 | /usr/local/bin/p0f-analyzer.pl 2345 &
> 
> At first, I tried putting that in /etc/rc.local. No luck, don't know why 
> it doesn't run. Ok, I tell myself, rc.local is a dinosaur anyway, take a 
> second and make a simple rc.d script.
> 
> So, I made /usr/local/etc/rc.d/p0fd containing:
> 
> ---
> 
> #!/bin/sh
> #

Quoting rc(8):
Each script should contain rcorder(8) keywords, especially an appropriate
“PROVIDE” entry, and if necessary “REQUIRE” and “BEFORE” keywords.

> 
> . "/etc/rc.subr"
> 
> name="p0f"
> rcvar=`set_rcvar`
> 
> command="/usr/local/bin/p0f"
> command_args="-l 'tcp dst port 25' 2>&1 | /usr/local/bin/p0f-analyzer.pl 2345 &"
> pidfile="/var/run/$name.pid"
> 
> # read configuration and set defaults
> load_rc_config "$name"
> : ${p0f_enable="NO"}
> 
> run_rc_command "$1"
> 
> ---
> 
> If I run "/usr/local/etc/rc.d/p0fd start" it fires right up. However, it 
> still continues to refuse to run on boot.
> 
> Any suggestions?
> 
> (yes, it's executable, and yes I have p0f_enable="YES" in rc.conf)
> 
> Thanks,
> Andy
> 
> ---
> Andy Dills
> Xecunet, Inc.
> www.xecu.net
> 301-682-9972
> ---

Yuri



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100512205840.GA1878>