Subject: rc.d/* help - writing my own script
To: None <netbsd-help@netbsd.org>
From: Jan Danielsson <jan.danielsson@gmail.com>
List: netbsd-help
Date: 02/03/2006 14:19:54
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig534EB6E3E1481A03DD7C4E3C
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,

   I have written a small python script which gathers statistics and
stores it in a database. Now I would like to launch (and stop) it using
the rc.d/ system.

   This is what I tried to use (without knowing much about how it all
works):

-------------------------------
#!/bin/sh

# PROVIDE: pflogger
# REQUIRE: pf pgsql
# KEYWORD: shutdown

$_rc_subr_loaded . /etc/rc.subr

name=3D"pflogger"
rcvar=3D$name
command=3D"/usr/local/bin/${name}.py"
pidfile=3D"/var/run/${name}.pid"

load_rc_config $name
run_rc_command "$1"
-------------------------------

   Problem is, this doesn't launch the script in a background process, i.=
e.:

# /usr/local/bin/pflogger.py &

   How do I accomplish this, and how so I make it stoppable via
"/etc/rc.d/pflogger stop" ?

Thankful for any hints or tips.


--=20
Kind Regards,
Jan Danielsson
Te audire non possum. Musa sapientum fixa est in aure.


--------------enig534EB6E3E1481A03DD7C4E3C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFD41h+8wBCTJQ8HEIRAmvtAJ9G8Rkamj033vnCxgB5V0A6sTYkEACgs+FB
KYC47c5FzeDKudk2WJQHXwE=
=6iiV
-----END PGP SIGNATURE-----

--------------enig534EB6E3E1481A03DD7C4E3C--