Re: [Twisted-Python] can I detect a child stopped?

2010-12-04 Thread Neal Becker
exar...@twistedmatrix.com wrote: > On 03:47 pm, ndbeck...@gmail.com wrote: >>Using processProtocol. If a child is stopped (e.g., by SIGSTOP), is >>there >>some way to detect this? > > The parent will get a SIGCHLD when the child gets SIGSTOP or SIGCONT. > Using sigaction, you can learn which pro

[Twisted-Python] can I detect a child stopped?

2010-12-04 Thread Neal Becker
Using processProtocol. If a child is stopped (e.g., by SIGSTOP), is there some way to detect this? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] signalfd

2010-11-17 Thread Neal Becker
One more piece seems available: http://code.google.com/p/python-atfork/ ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] my batch queue code

2010-11-12 Thread Neal Becker
My simple batch processing system is moved here: http://code.google.com/p/batch-queue/ Seems to be reasonably functional. Any suggestions/contributions appreciated. One thing todo is to add some authentication. For now the server listens for xmlrpc requests and will run any command without a

Re: [Twisted-Python] twisted daemonize problem

2010-11-09 Thread Neal Becker
Thanks for the suggestions. I'd also like to add authentication, but it seems rather daunting. Maybe I could just restrict the xmlrpc to listen only on connection from the local host? ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com h

Re: [Twisted-Python] twisted daemonize problem

2010-11-08 Thread Neal Becker
I seem to have things working OK with twistd. My app is a batch scheduling system that listens for commands via xmlrpc. It is very simple at this point, and I'm attaching it. I would welcome any suggestions for improvement, since I'm a newb to twisted, and a lot of this was guesswork. task.p

Re: [Twisted-Python] twisted daemonize problem

2010-11-08 Thread Neal Becker
Itamar Turner-Trauring wrote: > On Mon, 2010-11-08 at 08:53 -0500, Neal Becker wrote: >> I try to daemonize twisted, but it uses 100% cpu. >> >> The problem occurs in this code: > > Why not use twistd, which does all this for you already? E.g. > http://twistedma

[Twisted-Python] twisted daemonize problem

2010-11-08 Thread Neal Becker
I try to daemonize twisted, but it uses 100% cpu. The problem occurs in this code: def daemonize(log_stdout=False, out_name=None, log_stderr=False, err_name=None): """ Turn current process into a daemon """ pid = os.fork() if (pid == 0): ##os.chdir (workdir) o

[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

[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?

[Twisted-Python] signalfd

2010-11-03 Thread Neal Becker
On modern linux, signalfd can be used to convert sigchld into an event on a file descriptor. Looks like just what is wanted for processProtocol. There is also a python interface here: https://launchpad.net/python-signalfd/+download This test seems to work for me: import signalfd import signal