Subject: Re: 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 15:23:40
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig0850837BCC57AF6FC62C2A4C
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Jukka Salmi wrote:
>> How do I accomplish this, and how so I make it stoppable via
>> "/etc/rc.d/pflogger stop" ?
>=20
> To start the script in the background, set
>=20
> command_args=3D'&'
>=20
> in your rc script.
Hmm... That doesn't seem to help. Is there something more I need to do?
> To be able to shut down the process, just add
>=20
> command_interpreter=3D'/path/to/your/python/binary'
>=20
> to the rc script; `/etc/rc.d/your-script stop' should work now.
I guess it does, but I'm not able to try since it didn't start as a
background process.
This is what I have now:
--------------------------
#!/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"
command_interpreter=3D"/usr/pkg/bin/python24"
command_args=3D"&"
pidfile=3D"/var/run/${name}.pid"
load_rc_config $name
run_rc_command "$1"
--------------------------
--=20
Kind Regards,
Jan Danielsson
Te audire non possum. Musa sapientum fixa est in aure.
--------------enig0850837BCC57AF6FC62C2A4C
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)
iD8DBQFD42dw8wBCTJQ8HEIRAjcTAJ4weYm0B7z2BeCz+XruN23Zky2XGgCgsZDh
0C4NSyVzHzG7SE1Cb/eUSCg=
=nUmp
-----END PGP SIGNATURE-----
--------------enig0850837BCC57AF6FC62C2A4C--