Date: Mon, 20 Sep 2004 01:33:27 +0100 From: Lewis Thompson <lewiz@fajita.org> To: ports@freebsd.org Subject: Help with RCNG-style startup script. Message-ID: <20040920003327.GA2405@fajita.org>
next in thread | raw e-mail | index | archive | help
--wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Okay, I am stumped by how to write a startup file for a python app and have it work right. Basically I start the app with ``freevo start'' (I betcha an't guess how to stop it?). There is no pidfile created (actually, there is, but I have two other instances (freevo recordserver start, freevo webserver start) that do not create pidfiles. I mentioned these were run by python. If I grep some ps output we get: root 51905 0.0 4.0 18196 15356 p0 S 1:11AM 0:00.60 python -OO /u= sr/local/lib/python2.3/site-packages/freevo/helpers/recordserver.py root 51912 0.0 3.0 14464 11596 p0 S 1:11AM 0:00.38 python -OO /u= sr/local/lib/python2.3/site-packages/freevo/helpers/webserver.py root 51916 0.0 0.3 2108 1296 p0 I 1:11AM 0:00.03 xinit /usr/loc= al/bin/freevo -force-fs -- :1 root 51924 0.0 0.9 4420 3560 p0 I 1:11AM 0:00.02 /usr/local/bin= /python /usr/local/bin/freevo -force-fs root 51927 0.0 9.3 37624 35444 p0 S 1:11AM 0:05.57 python -OO /u= sr/local/lib/python2.3/site-packages/freevo/main.py -force-fs The first two are the record and web servers, respectively. The bottom three are all part of the main one -- pid 51927. As you can see all are python -OO ...py. I've done my homework and read rc.subr(8). Basically I'm referring to procname and interpreter. I assume that python is my interpreter and procname is /usr/local/.../main.py (for the 51927 instances)? Unfortunately the first line of main.py does not have #!python in any form. Does anybody know how to go about getting the pid of these processes with the rc.subr-style scripts? I'm stuck and any help or hints would be appreciated. Thanks! -lewiz. --=20 I was so much older then, I'm younger than that now. --Bob Dylan, 1964. ------------------------------------------------------------------------ -| msn:lewiz@fajita.org | jabber:lewiz@jabber.org | url:www.lewiz.org |- --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBTiVXItq0KFQv7T8RAmm0AJ9RNVq01Pytn9KleII7TUOM+1OIPQCeOkzV X2EfGvX1552bstQBA63YDHw= =PA3w -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040920003327.GA2405>