Xref: utzoo comp.unix.questions:17077 comp.sys.att:7831 Path: utzoo!utgpu!watmath!att!cbnewsl!rubin From: rubin@cbnewsl.ATT.COM (michael.rubin) Newsgroups: comp.unix.questions,comp.sys.att Subject: Re: pg problem under ksh Message-ID: <2387@cbnewsl.ATT.COM> Date: 20 Oct 89 18:02:25 GMT References: <1156@msa3b.UUCP> Reply-To: rubin@cbnewsl.ATT.COM (Mike Rubin) Organization: AT&T Bell Laboratories Lines: 32 In article <1156@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes: >I am porting ksh to AIX. [...] After I get a clean compile and link, I fire-up >ksh and get a prompt. Then I type > pg foo >and I get > pg: cannot reopen stdout > >I have seen this message before, in particular on a 3B2 at an AT&T System >Administration class. What does it mean (aside from the obvious)? What do >I do about it? >-- >Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347 >gatech!nanovx!msa3b!kevin Pg tries to open /dev/tty and produces that message when it cannot. /dev/tty doesn't work when your login shell is not the controlling process of your terminal. If you do a ps -ef, your shell will probably have a terminal of "?". This is normally caused by some process having the terminal open before you logged in - e.g. something the last user ran that is hung or ignoring signals. That process then becomes the controlling process for the terminal. To fix this, find the offending process (it'll be the only one in a ps -ef listing that IS connected to your terminal) and kill -9 it, then log out and log in again. Do you have any zombie ksh's? However, you might also have something wrong in your ksh that causes it to relinquish control of the tty; maybe it's doing a setpgrp() incorrectly. --Mike Rubin