[Web-SIG] daemon tools

Sidnei da Silva sidnei at enfoldsystems.com
Thu Mar 8 15:01:03 CET 2007

On 3/8/07, Jim Fulton <jim at zope.com> wrote:
> 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?)
> ...

Well, it could be both really. But of course the easiest to integrate
with (from the I-dont-want-to-learn-anything-about-windows
perspective) would be the former.

> > 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.

Yeah, so I thought.

> > 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.

Well, it doesn't 'unify them' in the sense that you still have to send
Windows named events, but the event name indicates the expected
signal, by using 'Zope-<pid>-<signalid>'. So an event named
'Zope-1214-9' means SIGKILL for the pid 1214 for example.

Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214

More information about the Web-SIG mailing list