[Twisted-Python] Creating a daemon from my application
gary clark
burslem2001 at yahoo.com
Mon Mar 15 17:11:54 EDT 2010
from twisted.application import service,internet
from nfdmessenger import ServerContextFactory
from twisted.internet import ssl, reactor
def get_service():
serverContext = ServerContextFactory()
return internet.SSLServer(2000, serverContext,serverContext)
application=service.Application('nfdm')
service=get_service()
service.setServiceParent(application)
Thats better.
--- On Mon, 3/15/10, gary clark <burslem2001 at yahoo.com> wrote:
> From: gary clark <burslem2001 at yahoo.com>
> Subject: Re: [Twisted-Python] Creating a daemon from my application
> To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
> Date: Monday, March 15, 2010, 4:00 PM
> Ok the below works:
>
> from twisted.application import service,internet
> from nfdmessenger import ServerContextFactory
> from twisted.internet import ssl, reactor
>
>
> def get_service():
> serverContext = ServerContextFactory()
> return internet.SSLServer(2000,
> serverContext)
>
> application=service.Application('nfdm')
> service=get_service()
> service.setServiceParent(application)
>
>
> --- On Mon, 3/15/10, gary clark <burslem2001 at yahoo.com>
> wrote:
>
> > From: gary clark <burslem2001 at yahoo.com>
> > Subject: Re: [Twisted-Python] Creating a daemon from
> my application
> > To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
> > Date: Monday, March 15, 2010, 3:42 PM
> > Hello,
> >
> >
> > twistd -r epoll -y ./nfddaemon.tac
> >
> > The below is the .tac file:
> >
> > from twisted.application import service,internet
> > from nfdmessenger import ServerContextFactory
> > from twisted.internet import ssl, reactor
> >
> >
> > def get_service():
> > serverContext = ServerContextFactory()
> > return reactor.listenSSL(2000, serverContext,
> > serverContext)
> >
> > application=service.Application('nfdm')
> > service=get_service()
> > service.setServiceParent(application)
> >
> > Not sure what to do at this point. It runs and then
> dies,
> > doing something wrong in getService() dont know ehat
> the
> > correct syntax is:
> >
> > File "./nfddaemon.tac", line 12, in <module>
> >
> > service.setServiceParent(application)
> > exceptions.AttributeError: 'Port' object
> > has no attribute 'setServiceParent'
> >
> > Thanks,
> > Garyc
> >
> >
> >
> > --- On Mon, 3/15/10, Reza Lotun <rlotun at gmail.com>
> > wrote:
> >
> > > From: Reza Lotun <rlotun at gmail.com>
> > > Subject: Re: [Twisted-Python] Creating a daemon
> from
> > my application
> > > To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
> > > Date: Monday, March 15, 2010, 1:15 PM
> > > On Mon, Mar 15, 2010 at 6:03 PM, gary
> > > clark <burslem2001 at yahoo.com>
> > > wrote:
> > > > Yeh I have to install them and create a
> setup.py
> > to
> > > find the path.
> > >
> > > You only need to set your PYTHONPATH environment
> > variable.
> > >
> > > e.g.
> > >
> > > $ export PYTHONPATH=/path/to/dir/containing/code
> > >
> > > --
> > > Reza Lotun
> > > mobile: +44 (0)7521 310 763
> > > email: rlotun at gmail.com
> > > work: reza at tweetdeck.com
> > > twitter: @rlotun
> > >
> > > _______________________________________________
> > > Twisted-Python mailing list
> > > Twisted-Python at twistedmatrix.com
> > > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> > >
> >
> >
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python at twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> >
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
More information about the Twisted-Python
mailing list