[Debconf-devel] Bug#1061480: debconf should automatically be noninteractive if input is /dev/null
Josh Triplett
josh at joshtriplett.org
Sun Dec 29 21:25:38 GMT 2024
Colin Watson wrote:
> Sorry for my long delay in replying to this.
No problem; thank you for the response!
> On Mon, Sep 30, 2024 at 02:47:53PM -0700, Josh Triplett wrote:
>> I've written a draft patch for this, at
>> https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/18 . I've
>> also attached it here.
>>
>> I'm happy to try other approaches for this, as well; this was the
>> simplest.
>
> I'm trying to understand what's going on with the original setup before
> going ahead with this. Your original report shows that the Readline
> frontend (based on Teletype) is being used, but
> Debconf::FrontEnd::Readline already has a `-t STDIN` check. So your
> commit message comments about not having a TTY don't seem quite
> accurate: it looks as though the situation is that you _do_ have a TTY
> (at least enough for `-t STDIN` to succeed) but that it's broken and
> reads from it always return EOF. Does this sound right? (It sounds
> quite weird to me, and might point to a bug in your setup.)
No, my setup has stdin as /dev/null, and stdout/stderr as UNIX sockets, and no controlling TTY. (And, as you guessed, TERM unset.)
Note in particular that it's necessary to have no controlling TTY and have /dev/tty not exist, to avoid debconf's fallbacks that try to find a terminal to use.
Apologies for posting a transcript that didn't match the description of the bug I was reporting. The actual issue I was observing was with the teletype frontend, not the readline frontend.
(The transcript is from a different, related issue. I expect that 723843 might fix that one.)
> It would be helpful for me to have a reproducer for this. If I just try
> `env -u TERM apt install tzdata </dev/null`, I get behaviour that, while
> somewhat buggy, is not the same as what you reported and doesn't result
> in a hang:
I'll follow up with the right transcript.
> Setting up tzdata (2024b-4) ...
> debconf: unable to initialize frontend: Dialog
> debconf: (TERM is not set, so the dialog frontend is not usable.)
> debconf: falling back to frontend: Readline
> debconf: unable to initialize frontend: Readline
> debconf: (This frontend requires a controlling tty.)
> debconf: falling back to frontend: Teletype
> Configuring tzdata
> ------------------
>
> Please select the geographic area in which you live. Subsequent configuration
> questions will narrow this down by presenting a list of cities, representing
> the time zones in which they are located.
>
> 1. Africa 3. Antarctica 5. Asia 7. Australia 9. Indian
> 11. Etc
> 2. America 4. Arctic 6. Atlantic 8. Europe 10. Pacific
> Geographic area:
> Use of uninitialized value $_[1] in join or string at
> /usr/share/perl5/Debconf/DbDriver/Stack.pm line 112.
>
> Current default time zone: '/UTC'
> Local time is now: Sun Dec 29 14:35:42 UTC 2024.
> Universal Time is now: Sun Dec 29 14:35:42 UTC 2024.
> Run 'dpkg-reconfigure tzdata' if you wish to change it.
>
> Use of uninitialized value $val in substitution (s///) at
> /usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 4.
> Use of uninitialized value $val in concatenation (.) or string at
> /usr/share/perl5/Debconf/Format/822.pm line 85, <GEN6> line 4.
>
> #723843 is also somewhat related here, although without a reproducer I'm
> not quite sure whether it would fix your problem.
>
> Thanks,
>
> --
> Colin Watson (he/him) [cjwatson at debian.org]
More information about the Debconf-devel
mailing list