[Web-SIG] daemon tools
Jim Fulton
jim at zope.com
Thu Mar 8 12:45:18 CET 2007
On Mar 7, 2007, at 8:42 AM, Sidnei da Silva wrote:
> On Windows, the NT Service Controller does all the dirty job. And it's
> pretty easy to write a service in Python that can run any application.
> The simplest Python service is shorter than 30 lines I think.
Would such a controller:
- Invoke the application as a subprocess, or
- Be part pf the application. (For example, would it be more like
ll.daemon or zdaemon?)
...
> There's some stuff from zdaemon that would be useful though, and do
> not work on Windows today due to some over-unixism in zdaemon, like an
> interactive prompt and script runner as 'zopectl debug' and 'zopectl
> run', I'm sure those two don't need to know about 'fork' or signals.
Note that the scope of zdaemon, as it's name implies was always
limited to Unix. If it is reasonable to do so, I'd be happy to see s
single tool that handled both cases, although if there is a choice
between a single tool that handled both cases adequately and 2 tools
that handled both cases well, I'd pick the later.
Also note that the "script runner" feature you mention isn't part of
zdaemon. zdaemon has a subclassing interface, which is currently
undocumented, that Zope uses to add the "run" and "debug" commands.
These are Zope specific.
As I mentioned earlier, I'd personally be happy to see the shell mode
go.
> What I'm really interested in is in how the service would communicate
> with the program being controlled. This is the painful part, and where
> I think we need to work together to make sure it works on Windows and
> on *nix platforms. You can surely count on me to discuss that part.
I think an event model, as Robert Brewer described is a good start.
> As I mentioned on another thread, Zope uses 'signals' on *nix, and
> 'named events' on Windows, by means of the 'Signals' package in Zope.
I'm not familiar with that. :) So that unifies Unix signals and
windows events? Interesting.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Web-SIG
mailing list