Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'debug': 0.05; 'initialize': 0.05; 'function,': 0.07; 'parameter': 0.07; 'stderr': 0.09; 'stdout': 0.09; 'cc:addr:python-list': 0.10; 'parameters,': 0.16; 'stderr.': 0.16; 'subject:avoiding': 0.16; 'wrote:': 0.17; 'module': 0.19; 'parameters': 0.20; 'suggested': 0.20; 'cc:2**0': 0.23; 'errors': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'logging': 0.27; 'this.': 0.29; 'function': 0.30; 'suggestion': 0.32; 'print': 0.32; 'function.': 0.33; 'null': 0.33; 'received:google.com': 0.34; 'doing': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'fact': 0.38; 'some': 0.38; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'received:200': 0.71; 'andrea': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9pGgm0Z6gAvIMSmHWh+i02+yewnb/2wHTuW0g0ORTRA=; b=M+lFiytCANos2X2EhzXwGcOBLlwRid3LUoyFaVACPdVLL5E0r46kit2+JLwKNpG2Ib CfM2JRkvJZDuqSVmJDOYdKkusGud/p8tkxc4+aX0VEco67SdyqbtesbpVsGHZEfKzaiY njYrvC7Oaz2xH3J044ECh9ElBqkctSiILT/0/Z4EEwslWpFJ8VH9dLzftBLWhW+aU3nq +1FA+AdyMAn0oR61jgeZoXfGck3VA98UHj8c+hNmtkg4+/7uUkY7zlt1mgGUmhUFgoEa ZW44eqCGCMlP5yRyXvZiRWTbU1EV4Pou4MZDO9Y/uJy+9I+x14TPZ2Lfk8ElBlRONPoj uHlA== Date: Tue, 11 Dec 2012 11:45:57 -0300 From: peter User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: andrea crotti Subject: Re: forking and avoiding zombies! References: <50C6153F.8050205@gmail.com> <50C7282B.8000708@gmail.com> <50C7365F.20908@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355237647 news.xs4all.nl 6917 [2001:888:2000:d::a6]:46416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34624 On 12/11/2012 10:57 AM, andrea crotti wrote: > where in [] I have the PID of the process. > In this suggested way I should use some other files as standard output > and error, but for that I already have the logging module that logs > in the right place.. It's not realy neccesary do use the stderr and stdout parameters, in fact the default value for those parameters are null ('/dev/null'). The functionality is like this. All you print to stdout going to be in the stdout parameter of the daemon function, and the same thing for stderr. Now my suggestion for you, is you already have initialize a "logging file", just use the logging module to redirect informacion what's is doing your forked function, and use the stderr paramater of the daemon function to DEBUG errors in the forked function.