I have put together a simple twisted server using xmlrpc and process. I want to run this server as a unix daemon.
Specifically, detach from controlling terminal, and redirect stdout, stderr to a log file.
What is the easiest approach, and where to look for documentation on this?
I often use "nohup" for this sort of thing. An alternative would be to add it to /etc/init.d and /etc/rc?.d
Cheers,
Jason
On Fri, Nov 5, 2010 at 1:40 PM, Neal Becker ndbecker2@gmail.com wrote:
I have put together a simple twisted server using xmlrpc and process. I want to run this server as a unix daemon.
Specifically, detach from controlling terminal, and redirect stdout, stderr to a log file.
What is the easiest approach, and where to look for documentation on this?
Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Nov 5, 2010, at 1:40 PM, Neal Becker wrote:
I have put together a simple twisted server using xmlrpc and process. I want to run this server as a unix daemon.
Specifically, detach from controlling terminal, and redirect stdout, stderr to a log file.
What is the easiest approach, and where to look for documentation on this?
Write your server as a .tac file or twistd plugin, and then run twistd without -n.
See:
http://twistedmatrix.com/documents/10.1.0/core/howto/application.html http://twistedmatrix.com/documents/10.1.0/core/howto/tap.html
On Fri, Nov 5, 2010 at 17:40, Neal Becker ndbecker2@gmail.com wrote:
I have put together a simple twisted server using xmlrpc and process. I want to run this server as a unix daemon.
You might want to have a look at daemontools (http://cr.yp.to/daemontools.html). It will also take care of restarting your daemons if they die.
C