Devin,

This sounds like the best course of action, you need to use some form of external daemonization, whether the poor man's (and portable) nohup or daemon.

For the record, os.fork in CPython is a versatile tool that's not at all readily implementable for Jython, due to underlying limitations in the JVM. (Others may wish to look at this problem again.) However, it's possible to identify subsets of fork's functionality and implement an emulation. Jason Briggs' pseudofork is just one example, although I believe it's possible now to manipulate the triple of (thread, PythonInterpreter, and PySystemState) more succinctly; see for example the function exec_code_separately in test_sys_jy.py (http://fisheye3.atlassian.com/browse/~raw,r=5806/jython/trunk/jython/Lib/test/test_sys_jy.py).

Lastly, I'd suggest a more Jythonic solution to put this all together. http://bugs.python.org/issue1745722 shows how run SimpleXMLRPCServer in WSGI. With modjy supporting WSGI, you can then run it any servlet container of your choice, which generally would have decent daemonization wrappers for this sort of thing (or use daemon), not to mention other management functionality. If you wanted something lightweight, consider Hudson's Winstone or Jetty.

- Jim

On Mon, Jan 5, 2009 at 12:28 PM, Devin Venable <venable.devin@gmail.com> wrote:
In the end I decided to use the daemon utility (man daemon) to start and stop the jython daemon by unique name.

To start...

 daemon --name jybridge jython /opt/mypath/myprogram.py

To stop...

 daemon --name jybridge

Devin


On Mon, Jan 5, 2009 at 10:37 AM, Jeff Emanuel <jemanuel@frii.com> wrote:
In bash, use $!

Mohamed Lrhazi wrote:
> I am sorry... I was mistaken... thought it was straightforward.... like:
>
> start-my-process&
> mypid=$SOME_SPECIAL_SHELL_VAR


------------------------------------------------------------------------------

_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users




--
Jim Baker
jbaker@zyasoft.com