2008/8/21 Gabriel Genellina <[EMAIL PROTECTED]>:
> En Thu, 21 Aug 2008 02:46:06 -0300, Mathieu Prevot <[EMAIL PROTECTED]>
> escribió:
>
>>> So what is the right thing to do so my script
>>> returns 1 or 0 depending on its state and success ?
>
> I use something like this:
>
> def main(argv):
> tr
En Thu, 21 Aug 2008 02:46:06 -0300, Mathieu Prevot <[EMAIL PROTECTED]> escribió:
>> So what is the right thing to do so my script
>> returns 1 or 0 depending on its state and success ?
I use something like this:
def main(argv):
try:
try:
do_things()
return 0
finally:
2008/8/21 Mathieu Prevot <[EMAIL PROTECTED]>:
> 2008/8/20 Gabriel Genellina <[EMAIL PROTECTED]>:
>> En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak <[EMAIL PROTECTED]>
>> escribió:
>>
>>> On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote:
>>>
child = Popen(cmd.split(), stderr=flog
2008/8/20 Gabriel Genellina <[EMAIL PROTECTED]>:
> En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak <[EMAIL PROTECTED]>
> escribió:
>
>> On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote:
>>
>>> child = Popen(cmd.split(), stderr=flog)
>>> print "Server running [PID %s]"%(child.pid)
>>
En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak <[EMAIL PROTECTED]> escribió:
> On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote:
>
>> child = Popen(cmd.split(), stderr=flog)
>> print "Server running [PID %s]"%(child.pid)
>> fpid.write(child.pid)
>
> I think that the problem here
On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote:
> flog = open(logfile, 'w')
> fpid = open(pidfile, 'w')
> try:
> child = Popen(cmd.split(), stderr=flog)
> print "Server running [PID %s]"%(child.pid)
> fpid.write(child.pid)
What happens if you change:
fpid.write(child.pid)
into:
Hi there,
it seems that child.wait() is ignored when
print "Server running [PID %s]"%(child.pid)
fpid.write(child.pid)
are between the process creation child = Popen(cmd.split(),
stderr=flog) and child.wait().
It seems to be a bug, doesn't it ?
Mathieu
(I'm running x11vnv with args in the