autoconf
[Top][All Lists]
Advanced

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

RE: exec 0</dev/null vs. nohup?


From: Jay K
Subject: RE: exec 0</dev/null vs. nohup?
Date: Thu, 11 Nov 2010 11:30:30 +0000

Hey, I don't use nohup much, but I got this error again using it.
This time on an older MacOSX/Darwin system.


nohup.out:

../gcc-4.5/configure: line 527: 0: Bad file 
descriptor"/Volumes/luthien/home/hudson2/jaykrell/dev2/cm3/m3-sys/m3cc/src/m3makefile",
 li


% uname -a
Darwin apple.iceflower.in-berlin.de 8.11.0 Darwin Kernel Version 8.11.0: Wed 
Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh 
powerpc
apple.iceflower.in-berlin.de [~/jaykrell/dev2/cm3/scripts/python] hudson


  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
        test -d "$1/.";
      else
        case $1 in #(
        -*)set "./$1";;
        esac;
        case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
        ???[sx]*):;;*)false;;esac;fi
    '\'' sh       <== this is line 527
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"

SHELL=${CONFIG_SHELL-/bin/sh}


exec 7<&0 </dev/null 6>&1    <== This is what I suspect is the problem.



Removing the line didn't work.
I changed it to:
exec </dev/null 6>&1


Is a shell script writer free to grab any file descriptor other than 0,1,2?
How can you be sure your parent process doesn't have some of them in use?
Will this just close/reopen them if they are in use?
What is being execed?


Presumably I can get this under truss/strace or such.
esp. if it still occurs on OpenBSD.
I really just don't use nohup much, is the thing.


Thanks,
 - Jay


----------------------------------------
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> Subject: RE: exec 0
> Date: Tue, 1 Jun 2010 01:59:54 +0000
>
>
> agreed, I put it back until/unless I see the problem again.
>
>  - Jay
>
> ----------------------------------------
> > Date: Mon, 31 May 2010 21:24:28 +0200
> > From: address@hidden
> > To: address@hidden
> > CC: address@hidden
> > Subject: Re: exec 0
> >
> > Hello Jay,
> >
> > * Jay K wrote on Wed, May 26, 2010 at 03:17:39PM CEST:
> >> I don't have the full background any longer, but I made
> >> this change to a configure script:
> >>
> >> before:
> >>
> >> exec 7<&0 &1
> >>
> >> after:
> >>
> >> exec 6>&1
> >>
> >> my comment at the time (2008-06-03) was:
> >> take minor change to older boilerplate from other nearby
> >> configure files, in order to let it work under "nohup", on OpenBSD
> >> otherwise there is an error about an invalid file handle
> >>
> >> Make sense?
> >
> > Not really, to me at least.
> >
> >> Clearly you are doing this on purpose though.
> >
> > Yes, we are. If you need the original standard input during the
> > configure script, you can get at it with the AS_ORIGINAL_STDIN_FD
> > macro; see `info Autoconf "File Descriptor Macros"'.
> >
> >> Maybe it just prints an error but there's no error?
> >>
> >> I just did a quick experiment with just
> >>
> >> exec 0
> >>
> >> and nohup but couldn't get an error.
> >>
> >> I've surely upgraded OpenBSD in the meantime.
> >
> > Well, if you cannot reproduce an error any more, I'll go and claim
> > we shouldn't need to worry until you hit it again. ;-)
> >
> > Cheers,
> > Ralf
                                          


reply via email to

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