[Twisted-Python] [newb] daemon question

2010-11-05 Thread Neal Becker
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?

Re: [Twisted-Python] [newb] daemon question

2010-11-05 Thread Jason Rennie
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 wrote: > I have put together a simple twisted server using xmlrpc and process. I > want to run this server as a unix daemon. >

Re: [Twisted-Python] [newb] daemon question

2010-11-05 Thread Glyph Lefkowitz
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 approa

Re: [Twisted-Python] [newb] daemon question

2010-11-05 Thread Carlos Valiente
On Fri, Nov 5, 2010 at 17:40, 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. You might want to have a look at daemontools (http://cr.yp.to/daemontools.html). It will also take care of restarting your daemon

[Twisted-Python] More daemonize() / OSX API / USING_FORK_WITHOUT_EXEC_etc.

2010-11-05 Thread Erik van Blokland
Hi, A while back on Oct 13, 2010, at 7:20 PM, James Y Knight wrote: > You need to avoid using or importing any OSX APIs until after the > daemonization has occurred. Unfortunately, twisted executes the entire script > file before daemonizing. [that's unfortunate for other reasons besides this,

[Twisted-Python] [newb] another process question

2010-11-05 Thread Neal Becker
Using this code: ... def processEnded(self, reason): print "processEnded, task %s, status %s" % (self.task, reason.value.exitCode,) Here is what I get from a normally terminated process processEnded, task ['sleep', '4']31662, status 0 But now I kill the subprocess, with SIGTERM, and

Re: [Twisted-Python] [newb] another process question

2010-11-05 Thread Tim Allen
On Fri, Nov 05, 2010 at 07:28:24PM -0400, Neal Becker wrote: > The status > is passed in the form of a Failure instance, created with a .value that > either holds a ProcessDone object if the process terminated normally (it > died of natural causes instead of receiving a signal, and if the exit c

[Twisted-Python] Conch as a file transfer server

2010-11-05 Thread Laurens Van Houtven
Hi! I've figured out vaguely how to use Conch as a file transfer client thanks to the cftp script. I'm currently trying to adapt the simple SSH server script example (link below) to do file *serving*. I can't find any example code that actually does this or documentation on this subject. There's