Author zyasoft
Recipients teeohhem, zyasoft
Date 2015-12-16.19:11:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Besides some minor testing usage, Twisted uses `os.fork` for two purposes:

1. Daemonization support. For Java, we can do this a number of ways:

   a. Cassandra, as one example, simply closes stderr and stdout; see

            if (System.getProperty("cassandra-foreground") == null)

Note this doesn't actually daemonize anything; to do that, you need to use something like Debian's `start-stop-daemon` command, which is used by the DataStax init.d scripts.

    b. Various other good starting points exist for Linux. I found this blog post helpful:, which then points at the systemd man pages. Now that major distros have standardized on it, systemd especially works well and systemd can manage the complexity of daemonization. In other words, no worries about its former competitor, upstart.

    c. Apache Commons, specifically, using either jsvc for Unix-like systems or procrun for Windows to get the equivalent idea on that architecture. Tomcat uses this approach; see

2. Process building in `twisted.internet.process`. So this is really akin to what `subprocess` does, but looks like with more control. Perhaps it's something we can get at a Jython-specific equivalent using Java Native Runtime with, so long as we are on Unix-like systems.

Most likely the resolution of this bug is docs on the Jython wiki re daemonization; and possibly enhanced support for process building as part of a Jython-specific reactor.
Date User Action Args
2015-12-16 19:11:03zyasoftsetmessageid: <>
2015-12-16 19:11:03zyasoftsetrecipients: + zyasoft, teeohhem
2015-12-16 19:11:03zyasoftlinkissue2440 messages
2015-12-16 19:11:02zyasoftcreate