view wiki/server/mointwisted @ 4366:b1c2405d598e

mointwisted: added missing pidFile parameter
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Oct 2008 10:59:23 +0200
parents fc2f05f2b0bd
children 8bcdfd815639
line wrap: on
line source
#!/usr/bin/env python
    mointwisted - control MoinMoin Twisted server

    @copyright: 2004-2005 Thomas Waldmann, Nir Soffer
    @license: GNU GPL, see COPYING for details.

import sys, os

# a) Configuration of Python's code search path
#    If you already have set up the PYTHONPATH environment variable for the
#    stuff you see below, you don't need to do a1) and a2).

# a1) Path of the directory where the MoinMoin code package is located.
#     Needed if you installed with --prefix=PREFIX or you didn't use
#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')

# a2) Path of the directory where is located.
#sys.path.insert(0, '/path/to/mointwisted')

# b) Configuration of moin's logging
#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
#    You also don't need this if you are happy with the builtin defaults.
#    See wiki/config/logging/... for some sample config files.
#from MoinMoin import log

# PID file location, please use some appropriate full path (needs to be writable):
pidFile = ''

# Debug mode - show detailed error reports
#os.environ['MOIN_DEBUG'] = '1'

from MoinMoin.server import daemon
from mointwisted import Config

class TwistedScript(daemon.DaemonScript):

    def do_start(self):
        """ Override to use twistd daemonizer """
        os.system('twistd --python --pidfile %s' % self.pidFile)

script = TwistedScript(, pidFile, None)