Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: forking and avoiding zombies!

Reply
Thread Tools

Re: forking and avoiding zombies!

 
 
peter
Guest
Posts: n/a
 
      12-11-2012
On 12/11/2012 10:25 AM, andrea crotti wrote:
> Ah sure that makes sense!
>
> But actually why do I need to move away from the current directory of
> the parent process?
> In my case it's actually useful to be in the same directory, so maybe
> I can skip that part,
> or otherwise I need another chdir after..

You don't need to move away from the current directory. You cant use os
to get the current work directory

stderrfile = '%s/error.log' % os.getcwd()
stdoutfile = '%s/out.log' % os.getcwd()

then call the daemon function like this.

daemonize(stdout=stdoutfile, stderr=stderrfile)
 
Reply With Quote
 
 
 
 
Thomas Rachel
Guest
Posts: n/a
 
      12-11-2012
Am 11.12.2012 14:34 schrieb peter:
> On 12/11/2012 10:25 AM, andrea crotti wrote:
>> Ah sure that makes sense!
>>
>> But actually why do I need to move away from the current directory of
>> the parent process?
>> In my case it's actually useful to be in the same directory, so maybe
>> I can skip that part,
>> or otherwise I need another chdir after..

> You don't need to move away from the current directory. You cant use os
> to get the current work directory
>
> stderrfile = '%s/error.log' % os.getcwd()
> stdoutfile = '%s/out.log' % os.getcwd()


ITYM

os.path.join(os.getcwd(), 'error.log')

resp.

os.path.join(os.getcwd(), 'out.log')


Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: forking and avoiding zombies! andrea crotti Python 1 12-12-2012 03:23 PM
Re: forking and avoiding zombies! peter Python 0 12-11-2012 12:33 PM
Re: forking and avoiding zombies! andrea crotti Python 0 12-11-2012 11:47 AM
Re: forking and avoiding zombies! peter Python 0 12-10-2012 05:00 PM
forking and avoiding zombies! andrea crotti Python 0 12-10-2012 03:42 PM



Advertisments