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

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-246210538-1273698816=:37652
Content-Type: TEXT/PLAIN; charset=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 13 May 2010, Yuri Pankov wrote:

> On Wed, May 12, 2010 at 04:20:12PM -0400, Andy Dills wrote:
> >=20
> > I'm working on integrating p0f with amavisd-new, and the command I need=
=20
> > to run at startup is a little unwieldy:
> >=20
> > p0f -l 'tcp dst port 25' 2>&1 | /usr/local/bin/p0f-analyzer.pl 2345 &
> >=20
> > At first, I tried putting that in /etc/rc.local. No luck, don't know wh=
y=20
> > it doesn't run. Ok, I tell myself, rc.local is a dinosaur anyway, take =
a=20
> > second and make a simple rc.d script.
> >=20
> > So, I made /usr/local/etc/rc.d/p0fd containing:
> >=20
> > ---
> >=20
> > #!/bin/sh
> > #
>=20
> Quoting rc(8):
> Each script should contain rcorder(8) keywords, especially an appropriate
> =E2=80=9CPROVIDE=E2=80=9D entry, and if necessary =E2=80=9CREQUIRE=E2=80=
=9D and =E2=80=9CBEFORE=E2=80=9D keywords.

Thanks for the reply.

I added this to the script (and renamed it p0f instead of p0fd):

# PROVIDE: p0f
# REQUIRE: LOGIN
# BEFORE:  securelevel
# KEYWORD: shutdown

It did not change the result, it still fails to start on boot, and still=20
works if I call "/usr/local/etc/rc.d/p0f start" once I login to the box=20
after it boots. Any other suggestions?

I have to assume it has something to do with either the redirection of=20
stdout and stderr to a script that is then backgrounded? If I do something=
=20
that doesn't involve all of that, it starts fine on boot.

How do I correct this? Earlier attempts went as far as to make a script to=
=20
start the process, and then call the script from /etc/rc.local. I even=20
tried doing a "/usr/local/etc/rc.d/p0f start" in /etc/rc.local. Nothing=20
works until I go in and run the startup script by hand.

Thanks,
Andy

---
Andy Dills
Xecunet, Inc.
www.xecu.net
301-682-9972
---
--0-246210538-1273698816=:37652--



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