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 17:46:44
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigC13DD2246E7D7C2F733C1712
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Jukka Salmi wrote:
[---]
>> # head -1 /usr/local/bin/pflogger.py
>> #!/usr/bin/env python
>>
>> Do I need to change that to something else?
>=20
> Hmm, didn't you get something like
>=20
>     WARNING: $command_interpreter /usr/pkg/bin/python24 !=3D /usr/bin/e=
nv
>=20
> when issuing '/etc/rc.d/pflogger start'?

   No... But I noticed that the python binary was actually called
python2.4. I fixed that.

> However, if you change the first line of your Python script to
>=20
> #!/usr/pkg/bin/python24
>=20
> your problem should be solved.

   Many thanks.. However, one issue remains. The "stop" command doesn't
work, it claims there is no pid-file (which there isn't; I checked). Do
I need to tell it to create a pid-file in some way?

   Oh, btw, I installed postgresql80, and it has the same problem (with
regards to the stop-command). Each time I shutdown it questions the fact
that postmaster is running, because its pid-file is missing.

------------------------
# cat /etc/rc.d/pflogger
#!/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/python2.4"
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.


--------------enigC13DD2246E7D7C2F733C1712
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)

iD8DBQFD44j38wBCTJQ8HEIRAomvAJ4w1yjBPEMn30B4cmtbfc8Ikf9e1gCfVY0e
Q17M0niaesBQM/L0rAAiZrQ=
=2ewv
-----END PGP SIGNATURE-----

--------------enigC13DD2246E7D7C2F733C1712--