Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'say,': 0.05; 'suppose': 0.07; '(its': 0.09; 'executed': 0.09; 'if,': 0.09; 'kumar': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'definition.': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:python': 0.16; 'previously': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'controlling': 0.24; 'fine': 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'rest': 0.29; "doesn't": 0.30; 'code': 0.31; 'writes:': 0.31; 'file': 0.32; 'probably': 0.32; 'run': 0.32; 'running': 0.33; 'entirely': 0.33; 'subject:with': 0.35; 'basic': 0.35; 'case,': 0.35; 'but': 0.35; 'really': 0.36; 'options:': 0.36; 'so,': 0.37; 'two': 0.37; 'server': 0.38; 'ben': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; "you're": 0.61; 'happen': 0.63; 'cut': 0.74; 'received:125': 0.84; 'subject:together': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Struggling with python-daemon and subprocess module to work together Date: Wed, 22 Oct 2014 11:04:39 +1100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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.3 (gnu/linux) Cancel-Lock: sha1:NQ8hQs8Xv30tVcYSkX/ZrClz+xc= 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413936295 news.xs4all.nl 2918 [2001:888:2000:d::a6]:53003 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79405 Praveen Kumar writes: > Previously this basic server is executed using *openvt* but I thought > it would be nice to have a daemon process for it and used > python-daemon. An important difference is that a daemon process has no controlling terminal, by definition. > Issue I am facing is after some time server will stop sending data to > client which suppose to happen in #120 and get error message "Cannot > run interactive console without a controlling TTY" . So, if the code you're running inside that daemon process needs access to a terminal, you have at least two options: * If the code really needs to talk on an interactive terminal, fake it with a pseudoterminal, and keep that pseudoterminal (its file handle) open. * If, as is probably the case, the code doesn't actually need to talk on an interactive terminal, cut that part of the code out entirely and the rest will run fine inside the daemon. -- \ “I may disagree with what you say, but I will defend to the | `\ death your right to mis-attribute this quote to Voltaire.” | _o__) —Avram Grumer, rec.arts.sf.written, 2000-05-30 | Ben Finney