Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: redirecting stdout and stderr to /dev/null Date: Sun, 08 May 2016 11:21:10 +1000 Lines: 15 Message-ID: References: <85r3ddfipl.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de aXXaA6ZWBoAKTD6j6xKPaACdNzUFY2KoiHM+IzRsqEpg== Cancel-Lock: sha1:/9fASil6tP4etraeFzKwzRflXxA= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url:pypi': 0.03; 'bits': 0.07; '/dev/null': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stderr': 0.09; 'stdout': 0.09; '8bit%:32': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:dev': 0.16; 'library': 0.20; 'unix': 0.24; 'header:User- Agent:1': 0.26; "doesn't": 0.26; 'header:X-Complaints-To:1': 0.26; 'jim': 0.27; 'fork': 0.29; "i'm": 0.30; 'subject:/': 0.30; 'url:python': 0.33; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'turn': 0.37; 'received:org': 0.37; 'does': 0.39; 'takes': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'care': 0.60; 'your': 0.60; 'skip:\xe2 10': 0.70; 'wish': 0.71; '_o__)': 0.84; 'received:125': 0.84; 'redirecting': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <85r3ddfipl.fsf@benfinney.id.au> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:108312 Jim Dodgen writes: > I'm have problems redirecting stdout and stderr to /dev/null in a > program that does a fork and exec. You may be interested in the ‘python-daemon’ library . It takes care of all the fiddly bits to turn your program into a well-behaved Unix daemon. -- \ “I wish there was a knob on the TV to turn up the intelligence. | `\ There's a knob called ‘brightness’ but it doesn't work.” | _o__) —Eugene P. Gallagher | Ben Finney