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

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Aug 7 18:14:34 EDT 2001

On Tue, 7 Aug 2001, Moshe Zadka wrote:

> daemonize() is cool, useful and should really be refactored out
> of twistd
> I really see no harm in providing more functionality in t.i.main
> Flamewars re: correct debian packaging will be left for later.


Daemonize's functionality is probably useful, however, there are a few
things it doesn't take into account.  Insofar as it's useful, most of
twistd should probably be incorporated into it; any less is offering
incomplete functionality.

After all, this is about as platform specific as you get.  If we have
daemonize, then we probably want to have a similiar function for starting
a Windows Service.  Moreover, it would be good if we could detect which
platform we're on, then do the appropriate thing for creating a daemon on
that platform.

This implies logging.  "daemonize" won't work if you're still writing to
standard output after you call it.

So I'd say daemonize should at least take a logfile, and a function +
varargs, and never return.

> Here's a quick thought about Debian packaging:
> add a script to ./bin "debianize".
> This script will take a .tap file and create a package named the same
> as the .tap file which relevant /etc/init.d/package and 
> /var/lib/package/package.tap
> Perhaps even add it as a generic argument to mktap, so
> mktap --debian web --static /var/www
> will create the debian package.
> One caveat: version numbers.

This sounds cool, with one minor caveat.

I don't want to give windows users the impression that they're totally
unsupported, especially any more than they already are.

We should make plans to have similiar windows-ize scripts, and even if we
don't have them, make it clear that we're not trying to make a
debian-specific server infrastructure.

Also, wouldn't this "debian" functionality be very similiar for redhat,
mandrake, etc?  Even solaris and MacOS X?  "unixize" might be a better
name for it.

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

More information about the Twisted-Python mailing list