I've attempted to switch out spawnProcess for subprocess.Popen

e.g.

               command = "xvfb-run --auto-servernum firefox"
                args = shlex.split(command)
                #p = subprocess.Popen(args)
                #logging.debug("spawned a process: pid: %d", p.pid)
                subprocess =
reactor.spawnProcess(TimedProcessProtocol(20), args[0], args)

                logging.debug(type(subprocess))
                logging.debug("spawned a process: pid: %d", subprocess.pid)

when using subprocess.Popen, xvfb does start up correctly, but then I
have a python issue which is that xfb will start firefox-bin and make
it the parent and exit, thus, making it hard to kill the new process
of which I don't know the pid of.

in any case, I'd like to use spawnProcess, so any help as to why this
isn't working would be helpful.

Stephan

On Sat, Aug 20, 2011 at 10:52 AM, Stephan <[email protected]> wrote:
> Hi Glyph,
>
> I've created a specially crafted runnable example
> you can find it here: http://pastebin.com/dyhTFPjM
>
> as you'll see in the debug log that is created:
>
> 2011-08-20 10:36:10,484 DEBUG:errReceived xvfb-run: error: Xvfb failed to 
> start
> 2011-08-20 10:36:10,486 DEBUG:inConnectionLost
> 2011-08-20 10:36:10,486 DEBUG:errConnectionLost
> 2011-08-20 10:36:10,487 DEBUG:process exited, status 1
>
> Any help is appreciated.
> to install xvfb on linux if not already installed
> sudo apt-get install xvfb
>
> On Fri, Aug 19, 2011 at 1:22 AM, Glyph Lefkowitz
> <[email protected]> wrote:
>> On Aug 19, 2011, at 1:14 AM, Stephan wrote:
>>
>> Thanks for the prompt reply response inline. I'm still having issues
>> even though I've changed some code based on your advice.
>>
>> Perhaps you could reduce this to a complete, runnable example so that
>> someone could reproduce the behavior you're seeing.  At this point further
>> advice would be guessing on my part.
>> _______________________________________________
>> Twisted-web mailing list
>> [email protected]
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>>
>>
>

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to