This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [setup] [PATCH] Redirect stdin from /dev/null when runningpostinstall scripts
On Wed, 15 Sep 2004, Max Bowsher wrote:
> Igor Pechtchanski wrote:
> > On Tue, 14 Sep 2004, Max Bowsher wrote:
> >
> > > Igor Pechtchanski wrote:
> > > > Hi,
> > > >
> > > > The patch below redirects stdin from /dev/null when running postinstall
> > > > scripts, so that installation doesn't hang if a program called from a
> > > > postinstall script decides to ask the user something. AFAICS, this is
> > > > against the CVS HEAD.
> > > > Igor
> ...
> > >
> > > I tried to test this patch, but I wasn't able to reproduce the hang even
> > > before applying it !?
> > > Could you explain how to reproduce the hang?
> >
> > :-) I never saw the hang, actually. The patch is just common sense.
>
> Indeed it is. Please go ahead and commit it.
Done.
> > However, AFAIU, you need to call a program that reads stdin from the
> > postinstall script. Putting in a shell read should be enough, but
> > apparently isn't -- try different shells, though, as they may be using
> > different mechanisms for reading stdin. The best thing to do would be to
> > look at the texconfig source, and see exactly what *it* is using, as it
> > definitely blocks.
>
> It appears to be using /bin/sh and read - which is what I tested!?!?
Are you saying that the following postinstall script worked for you?
--- BEGIN BLAH.sh ---
#!/bin/sh
read dummy
---- END BLAH.sh ----
> And installing tetex-tiny worked just fine for me.
I believe it doesn't always attempt to read from stdin, only when there's
something incompatible in the environment.
> I'd be interested in a reproduction recipe if anyone has one...
The BLAH.sh above should work (but I haven't tested it, as I don't have
the time at the moment).
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing." -- Dr. Jubal Harshaw