Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79405 > unrolled thread

Re: Struggling with python-daemon and subprocess module to work together

Started byBen Finney <ben+python@benfinney.id.au>
First post2014-10-22 11:04 +1100
Last post2014-10-22 11:04 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Struggling with python-daemon and subprocess module to work together Ben Finney <ben+python@benfinney.id.au> - 2014-10-22 11:04 +1100

#79405 — Re: Struggling with python-daemon and subprocess module to work together

FromBen Finney <ben+python@benfinney.id.au>
Date2014-10-22 11:04 +1100
SubjectRe: Struggling with python-daemon and subprocess module to work together
Message-ID<mailman.15051.1413936295.18130.python-list@python.org>
Praveen Kumar <kumarpraveen.nitdgp@gmail.com> 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web