'Configure global process state based on the given application and run
the application.
@param application: An object which can be adapted to
L{service.IProcess} and L{service.IService}.'

def startApplication(self, application):

    process = service.IProcess(application)
    if (not self.config['originalname']):
        launchWithName(process.processName)
    self.setupEnvironment(self.config['chroot'], self.config['rundir'], self.config['nodaemon'], self.config['umask'], self.config['pidfile'])
    service.IService(application).privilegedStartService()
    (uid, gid) = (self.config['uid'], self.config['gid'])
    if (uid is None):
        uid = process.uid
    if (gid is None):
        gid = process.gid
    self.shedPrivileges(self.config['euid'], uid, gid)
    app.startApplication(application, (not self.config['no_save']))
