From owner-freebsd-questions@FreeBSD.ORG Wed May 12 20:58:45 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE1FC106564A for ; Wed, 12 May 2010 20:58:45 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 449A38FC16 for ; Wed, 12 May 2010 20:58:44 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1591667fge.13 for ; Wed, 12 May 2010 13:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mq5wyTC1FUuhoOmzB6Gdj+zsbXMb0AUwf4Ry91U2qkQ=; b=g3wKNrE3kt+Ul6RrLc62GZOfykaNbNnRdBIbKukr0S1bePf33XzYSbdWCyud33Jz9K xgf9XXczS0C/DDVlgF2xyP081yNoYPaRwGharxhI3FvQ012vUuj8WQB0NUM7g1D4yL7U MSl5bGfAu01S5KQEwPvbksuYRGAV9deoXI6Rc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=mcD35aGJxI71wnUBFXNgv+81pnpuDbyURLf5LXfvSLPM5DqLqEZzwIBX4qR+WxjDRa 1VLKjPdhHkRDVQVDhqt00PnvdGOwou799UqeRPCl4wOez3QW/0lxjC5sGqE2P+ohPMjw O1xzvhfMJnMt3Ena05r99vL//kERgwtPLzMWw= Received: by 10.86.124.4 with SMTP id w4mr15200419fgc.54.1273697924217; Wed, 12 May 2010 13:58:44 -0700 (PDT) Received: from darklight.org.ru ([213.132.76.142]) by mx.google.com with ESMTPS id g28sm793987fkg.58.2010.05.12.13.58.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 May 2010 13:58:43 -0700 (PDT) Received: from darklight.org.ru (yuri@darklight.org.ru [127.0.0.1]) by darklight.org.ru (8.14.4/8.14.4) with ESMTP id o4CKwegq012948; Thu, 13 May 2010 00:58:41 +0400 (MSD) (envelope-from yuri.pankov@gmail.com) Received: (from yuri@localhost) by darklight.org.ru (8.14.4/8.14.4/Submit) id o4CKweeH012947; Thu, 13 May 2010 00:58:40 +0400 (MSD) (envelope-from yuri.pankov@gmail.com) X-Authentication-Warning: darklight.org.ru: yuri set sender to yuri.pankov@gmail.com using -f Date: Thu, 13 May 2010 00:58:40 +0400 From: Yuri Pankov To: Andy Dills Message-ID: <20100512205840.GA1878@darklight.org.ru> References: <20100512161505.H37652@shell.xecu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100512161505.H37652@shell.xecu.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-questions@freebsd.org Subject: Re: Why doesn't this startup script run? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2010 20:58:45 -0000 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