bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disowned process hangs terminal during logout/exit


From: Paul Jarc
Subject: Re: Disowned process hangs terminal during logout/exit
Date: Wed, 05 Dec 2007 15:49:09 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Jesse Molina <jesse@opendreams.net> wrote:
> Basically, on the two troubled systems, my interactive shell will
> hang after I've disowned a process.  On one other system, everything
> works as expected.  I expect that a disowned process should not hang
> logout -- disowned means disowned.

The terminal will hang around as long as any process has an open
descriptor connected to it.  "disown" does not (and cannot) disconnect
an already-running process's file descriptors from the terminal.  It
only affects the relationship between the process and bash, not
between the process and the terminal.

> It seems like it's hanging on stdout since redirecting to /dev/null fixes the 
> problem.

You could have the same problem with stdin/stderr.

> Here is the actual line where I am having trouble.  I can't redirect tail's 
> output in this case.  It seems like tail is the offender.
>
> (tail -f < /dev/null | $NETCAT -l -p $LISTENPORT >> $LOGFILE 2>&1) &

tail's stderr would still be connected to the terminal in that case.
See if this works:
(tail -f < /dev/null 2> /dev/null | $NETCAT -l -p $LISTENPORT >> $LOGFILE 2>&1) 
&


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]