shoudn't nohup close stdin ?

Samuel Landau <[email protected]> Sun, 15 Sep 2002 22:00:14 +0200
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
Hello

Scripts launched with nohup make ssh hang on exit because nohup does not close
stdin when exec'ing command. Shouldn't it close stdin ? Its default behavior
is to redirect stdout and stderr, so why not closing stdin as well ?

here's a patch :

$ diff nohup.nostdin /usr/bin/nohup  
76c76 
<     exec "$niceprog" -5 -- "$@" >> nohup.out 2>&1 <&- 
--- 
>     exec "$niceprog" -5 -- "$@" >> nohup.out 2>&1 
81c81 
<     exec "$niceprog" -5 -- "$@" >> $HOME/nohup.out 2>&1 <&- 
--- 
>     exec "$niceprog" -5 -- "$@" >> $HOME/nohup.out 2>&1 
85c85 
<   exec "$niceprog" -5 -- "$@" <&- 
--- 
>   exec "$niceprog" -5 -- "$@" 

Regards,

-- 
Samuel Landau
Doctorant LIP6 - équipe MIRIAD (SMA)
LIP6 PhD student - MIRIAD team (MAS)
homepage : http://miriad.lip6.fr/~landau