[Twisted-Python] new function for t.i.main

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Aug 8 07:44:08 EDT 2001

On Wed, 8 Aug 2001, Moshe Zadka wrote:

> On Tue, 7 Aug 2001, Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:
> > any less is offering incomplete functionality.

> No it isn't. It's offering *just* the daemonize functionality. You can
> have a higher-level wrapper *on top* of that which is portable, but
> daemonize() is useful.

Sorry, no.  If you don't redirect stdout properly, your daemon is broken,
unix or no.

> > Moreover, it would be good if we could detect [...]

> Agreed.
> But not with daemonize() -- with startService(....) which would call
> daemonize() on UNIX.

Yes.  And it should be strongly deprecated to call daemonize directly.

> > So I'd say daemonize should at least take a logfile, and a function +
> > varargs, and never return.
> No, that's startService, another useful API. 

I would argue that daemonize is not useful without this API.  It's
sufficiently small that everyone who wants to write UNIX-specific servers
has to know about it anyway; and if they don't want to know about those
sorts of things they ought to use the cross-platform API.

> *I* don't care if my server infrastructure is Debian specific.

Yes, and it's people like you that I'm trying to protect users from :-)

What additional _semantics_ does unix 'daemonize' provide that a
cross-platform startBackgroundServer() doesn't?  Do you really need the
extra 40-odd bytes of stack space for the Python frame that you're losing
by having a call-through approach rather than returning?

All it really lets you do is write servers that require a programmer to
run on Windows.  If there's no good reason for that, it's silly.

For example, although the 'process' object doesn't currently run on
Windows, its external API just relies on the notion of a process which can
be written to and read from as a file.  Once Jürgen finally writes that
cgi-for-nt implementation he was talking about many months ago, I'm sure
it'll work fine on that platform ;-).

> I want the Debian packages to be good enough that I'll feel good enough
> about uploading them to the official Debian archive, as well as maintainig
> a huge apt source on tm.com. 

Well, I definitely support your desire for high quality.  However, what's
this about a "huge apt source on tm.com"?

                      ______      __   __  _____  _     _
                     |  ____ |      \_/   |_____] |_____|
                     |_____| |_____  |    |       |     |
                     @ t w i s t e d m a t r i x  . c o m

More information about the Twisted-Python mailing list