Re: Help on /dev/tty and su -c
Hello,
On Wed, Mar 14, 2012 at 11:21 PM, Francesco Poli
<invernomuto@paranoici.org> wrote:
> The most general issue is that apt-listbugs needs to perform the
> following steps (when run in "apt" mode):
>
> * first it reads some input through its STDIN, through a pipe
>
> * when this input ends (EOF), apt-listbugs needs to be able to become
> interactive and ask questions to the user, and get answers from STDIN,
> and possibly also run a web browser (that could be a textual browser,
> depending on the user preferences) and let the user interact with the
> browser
>
> Currently, apt-listbugs does all this by opening "/dev/tty", after the
> input ends.
Does it do that as root ? Why do you need su ?
Could you try posting the output of
p Dir["/proc/self/fd/*"].map {|x| begin File::readlink(x); rescue; end }
just before opening /dev/tty ? If 2 or 1 is a /dev/pts, not all hope is lost.
I know this is probably a lot of work, but wouldn't it be just saner
to use debconf rather than the terminal ? That would be more portable.
You could also try prompting using readline, which may (? haven't
checked) be able to find a tty even if /dev/tty isn't available.
Hope that helps,
Vincent
Reply to: