To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: debconf should automatically be noninteractive if input is /dev/null
Date: Thu, 25 Jan 2024 00:25:25 -0800
Package: debconf
Version: 1.5.84
Severity: normal
X-Debbugs-Cc: josh@joshtriplett.org
I'm building a system for remotely running noninteractive commands. That
system lets people run commands like `apt-get install xyz` to install
packages, but it by design has no specific knowledge of any software
like apt or dpkg (and thus *cannot* set things like
DEBIAN_FRONTEND=noninteractive for the user).
I run commands with stdout/stderr connected to a socket, and stdin
connected to /dev/null, since all commands are non-interactive and can
receive no input. Generally, this results in software noticing that it
cannot get input, and handling that.
In a recent attempt to install a package, tzdata got pulled in as a
dependency, resulting in this:
```
Setting up tzdata (2021a-1+deb11u11) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
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. Arctic 7. Atlantic 9. Indian 11. US
2. America 4. Australia 6. Asia 8. Europe 10. Pacific 12. Etc
```
And then the command hung, fruitlessly attempting to wait for input that
will never arrive.
debconf should detect if reading from stdin produces EOF (a zero-byte
read, e.g. because it's /dev/null), and automatically switch to a
noninteractive mode, rather than hanging.
(In an ideal world, I'd also say that debconf should do this anytime its
stdin is not a tty and it doesn't explicitly have a non-tty-requiring
frontend set, rather than falling back to "readline" on a non-terminal,
but I understand if this is historical behavior that'd be difficult to
change for compatibility reasons. Dealing with EOF on stdin better would
be the next best thing.)
-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64
Kernel: Linux 6.6.11-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
debconf depends on no packages.
Versions of packages debconf recommends:
ii apt-utils 2.7.10
pn debconf-i18n <none>
Versions of packages debconf suggests:
pn debconf-doc <none>
pn debconf-kde-helper <none>
pn debconf-utils <none>
ii libgtk3-perl 0.038-3
pn libnet-ldap-perl <none>
pn libterm-readline-gnu-perl <none>
ii perl 5.38.2-3
ii whiptail 0.52.24-2
-- debconf information excluded
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Mon, 30 Sep 2024 21:57:01 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Mon, 30 Sep 2024 21:57:01 GMT) (full text, mbox, link).
Added tag(s) patch.
Request was from Josh Triplett <josh@joshtriplett.org>
to control@bugs.debian.org.
(Mon, 30 Sep 2024 21:57:02 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Tue, 05 Nov 2024 14:39:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Tue, 05 Nov 2024 14:39:02 GMT) (full text, mbox, link).
Subject: Possible to get this patch in before trixie?
Date: Tue, 5 Nov 2024 06:29:46 -0800
I'm interested in trying to get this fixed before the trixie release.
Given the upcoming freeze, is there anything I could do to help with
this?
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Sun, 29 Dec 2024 14:45:01 GMT) (full text, mbox, link).
Acknowledgement sent
to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Sun, 29 Dec 2024 14:45:01 GMT) (full text, mbox, link).
To: Josh Triplett <josh@joshtriplett.org>, 1061480@bugs.debian.org
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Sun, 29 Dec 2024 14:40:06 +0000
Sorry for my long delay in replying to this.
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.)
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:
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@debian.org]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Sun, 29 Dec 2024 21:33:01 GMT) (full text, mbox, link).
Acknowledgement sent
to "Josh Triplett" <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Sun, 29 Dec 2024 21:33:01 GMT) (full text, mbox, link).
To: "Colin Watson" <cjwatson@debian.org>, 1061480@bugs.debian.org
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if input is
/dev/null
Date: Sun, 29 Dec 2024 13:25:38 -0800
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@debian.org]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Fri, 07 Mar 2025 18:06:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Fri, 07 Mar 2025 18:06:04 GMT) (full text, mbox, link).
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Fri, 7 Mar 2025 18:02:01 +0000
On Sun, Dec 29, 2024 at 01:25:38PM -0800, Josh Triplett wrote:
>Colin Watson wrote:
>> 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.
Ping - I can't seem to find anything from you with the right transcript
for this?
Thanks,
--
Colin Watson (he/him) [cjwatson@debian.org]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Sat, 08 Mar 2025 15:27:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Sat, 08 Mar 2025 15:27:02 GMT) (full text, mbox, link).
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Sat, 8 Mar 2025 07:17:29 -0800
On Fri, 7 Mar 2025 18:02:01 +0000 Colin Watson <cjwatson@debian.org> wrote:
> On Sun, Dec 29, 2024 at 01:25:38PM -0800, Josh Triplett wrote:
> >Colin Watson wrote:
> >> 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.
>
> Ping - I can't seem to find anything from you with the right transcript
> for this?
Sorry for the greatly delayed follow-up! Didn't get it done before going on
vacation, and lost track of it while on vacation.
It's difficult to construct a reproduction environment for this unless
you *specifically don't have any access to a terminal*, because several
of the pieces of software involved try very hard to reopen or create
one. Combinations of `setsid` and `nohup` don't suffice, for instance.
(I originally reproduced this using a VM-based batch environment with no
access to a terminal, with stdin coming from /dev/null, and stdout and
stderr going to UNIX sockets.)
I did manage to find a recipe for reproducing this on a stock Debian
system running systemd, by using `systemd-run`. I'm using the package
`wireshark-common` for the example, as it's a convenient package that
wasn't installed and has a debconf question. I had the latest debconf
(1.5.90), apt (2.9.31), and dpkg (1.22.17) installed, and
wireshark-common *not* installed (and its debconf answers not present in
/var/cache/debconf/config.dat).
Given that, the following command will reproduce this, and show the
output to the terminal:
systemd-run -P apt -y install wireshark-common </dev/null 2>&1 | cat
This produces:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
Installing:
wireshark-common
Installing dependencies:
libbcg729-0 libsmi2t64 libwireshark18 libwsutil16
libcares2 libwireshark-data libwiretap15
Suggested packages:
snmp-mibs-downloader geoip-database-extra wireshark-doc
geoipupdate libjs-leaflet
geoip-database libjs-leaflet.markercluster
Recommended packages:
wireshark | tshark
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
dpkg-preconfigure: unable to re-open stdin:
Summary:
Upgrading: 0, Installing: 8, Removing: 0, Not Upgrading: 94
Download size: 0 B / 22.8 MB
Space needed: 139 MB / 1155 GB available
Selecting previously unselected package libbcg729-0:amd64.
(Reading database ... 236549 files and directories currently installed.)
Preparing to unpack .../0-libbcg729-0_1.1.1-3_amd64.deb ...
Unpacking libbcg729-0:amd64 (1.1.1-3) ...
Selecting previously unselected package libcares2:amd64.
Preparing to unpack .../1-libcares2_1.34.4-2.1_amd64.deb ...
Unpacking libcares2:amd64 (1.34.4-2.1) ...
Selecting previously unselected package libsmi2t64:amd64.
Preparing to unpack .../2-libsmi2t64_0.4.8+dfsg2-17+b1_amd64.deb ...
Unpacking libsmi2t64:amd64 (0.4.8+dfsg2-17+b1) ...
Selecting previously unselected package libwireshark-data.
Preparing to unpack .../3-libwireshark-data_4.4.5-1_all.deb ...
Unpacking libwireshark-data (4.4.5-1) ...
Selecting previously unselected package libwsutil16:amd64.
Preparing to unpack .../4-libwsutil16_4.4.5-1_amd64.deb ...
Unpacking libwsutil16:amd64 (4.4.5-1) ...
Selecting previously unselected package libwiretap15:amd64.
Preparing to unpack .../5-libwiretap15_4.4.5-1_amd64.deb ...
Unpacking libwiretap15:amd64 (4.4.5-1) ...
Selecting previously unselected package libwireshark18:amd64.
Preparing to unpack .../6-libwireshark18_4.4.5-1_amd64.deb ...
Unpacking libwireshark18:amd64 (4.4.5-1) ...
Selecting previously unselected package wireshark-common.
Preparing to unpack .../7-wireshark-common_4.4.5-1_amd64.deb ...
Unpacking wireshark-common (4.4.5-1) ...
Setting up libsmi2t64:amd64 (0.4.8+dfsg2-17+b1) ...
Setting up libbcg729-0:amd64 (1.1.1-3) ...
Setting up libcares2:amd64 (1.34.4-2.1) ...
Setting up libwireshark-data (4.4.5-1) ...
Setting up libwsutil16:amd64 (4.4.5-1) ...
Setting up libwiretap15:amd64 (4.4.5-1) ...
Setting up libwireshark18:amd64 (4.4.5-1) ...
Setting up wireshark-common (4.4.5-1) ...
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 wireshark-common
----------------------------
Dumpcap can be installed in a way that allows members of the "wireshark" system
group to capture packets. This is recommended over the alternative of running
Wireshark/Tshark directly as root, because less of the code will run with
elevated privileges.
For more detailed information please see
/usr/share/doc/wireshark-common/README.Debian.gz once the package is installed.
Enabling this feature may be a security risk, so it is disabled by default. If
in doubt, it is suggested to leave it disabled.
Should non-superusers be able to capture packets? [yes/no]
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 112.
Use of uninitialized value $val in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 1.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/perl5/Debconf/Format/822.pm line 85, <GEN6> line 1.
Processing triggers for libc-bin (2.41-3) ...
Processing triggers for man-db (2.13.0-1) ...
Processing triggers for shared-mime-info (2.4-5+b2) ...
Processing triggers for hicolor-icon-theme (0.18-2) ...
The problem with this, compared to the noninteractive frontend, is that
1) it produces errors (and shows the question in the terminal log), and
2) it treats the question as "seen", when it really hasn't been.
I imagine that the errors could be fixed to handle a lack of input, with
a change similar to the fix for https://bugs.debian.org/723843 .
However, that wouldn't address the underlying problem that this
shouldn't be using the teletype frontend because it has no source of
input; that's what the patch I sent handles.
I hope the reproducer helps with this.
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Sun, 09 Mar 2025 12:39:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Sun, 09 Mar 2025 12:39:02 GMT) (full text, mbox, link).
On Sat, Mar 08, 2025 at 07:17:29AM -0800, Josh Triplett wrote:
>Given that, the following command will reproduce this, and show the
>output to the terminal:
>systemd-run -P apt -y install wireshark-common </dev/null 2>&1 | cat
Thanks for the reproducer! That helps a lot.
I'm more inclined to do something like the attached patch; my feeling is
that it was probably a mistake that we put the `-t STDIN` check in
Readline rather than in Teletype, and I'd rather fix that than add an
additional prompt. What do you think? It works with your reproducer,
automatically falling back to Noninteractive.
--
Colin Watson (he/him) [cjwatson@debian.org]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Mon, 10 Mar 2025 04:51:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Mon, 10 Mar 2025 04:51:03 GMT) (full text, mbox, link).
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Sun, 9 Mar 2025 21:39:29 -0700
On Sun, 9 Mar 2025 12:34:17 +0000 Colin Watson <cjwatson@debian.org> wrote:
> On Sat, Mar 08, 2025 at 07:17:29AM -0800, Josh Triplett wrote:
> >Given that, the following command will reproduce this, and show the
> >output to the terminal:
> >systemd-run -P apt -y install wireshark-common </dev/null 2>&1 | cat
>
> Thanks for the reproducer! That helps a lot.
>
> I'm more inclined to do something like the attached patch; my feeling is
> that it was probably a mistake that we put the `-t STDIN` check in
> Readline rather than in Teletype, and I'd rather fix that than add an
> additional prompt. What do you think? It works with your reproducer,
> automatically falling back to Noninteractive.
Works for me.
The main reason I'd avoided doing that was the thought that someone,
somewhere, might be using the teletype frontend with some kind of
install-scripting automation. (Such a setup would be a bad idea,
compared to pre-seeding debconf prior to installation, but people
develop all sorts of interesting workarounds for things and keep using
them as long as they work.)
However, I think in practice that's exceedingly unlikely, and if someone
really wants to keep doing it they could use a pty. Given that, I think
your patch is a much better solution.
I'm not clear why you're removing the `-t STDIN` check from the Readline
frontend, though; shouldn't *both* of those require a terminal? It
sounds like your tests show it falling all the way back to
Noninteractive, but what causes it to skip using Readline?
Thanks,
Josh
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Mon, 10 Mar 2025 12:06:01 GMT) (full text, mbox, link).
Acknowledgement sent
to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Mon, 10 Mar 2025 12:06:01 GMT) (full text, mbox, link).
To: Josh Triplett <josh@joshtriplett.org>, 1061480@bugs.debian.org
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Mon, 10 Mar 2025 12:03:54 +0000
On Sun, Mar 09, 2025 at 09:39:29PM -0700, Josh Triplett wrote:
>On Sun, 9 Mar 2025 12:34:17 +0000 Colin Watson <cjwatson@debian.org> wrote:
>> I'm more inclined to do something like the attached patch; my feeling is
>> that it was probably a mistake that we put the `-t STDIN` check in
>> Readline rather than in Teletype, and I'd rather fix that than add an
>> additional prompt. What do you think? It works with your reproducer,
>> automatically falling back to Noninteractive.
>
>Works for me.
>
>The main reason I'd avoided doing that was the thought that someone,
>somewhere, might be using the teletype frontend with some kind of
>install-scripting automation. (Such a setup would be a bad idea,
>compared to pre-seeding debconf prior to installation, but people
>develop all sorts of interesting workarounds for things and keep using
>them as long as they work.)
>
>However, I think in practice that's exceedingly unlikely, and if someone
>really wants to keep doing it they could use a pty. Given that, I think
>your patch is a much better solution.
Yes, I think this is pretty much my reasoning.
>I'm not clear why you're removing the `-t STDIN` check from the Readline
>frontend, though; shouldn't *both* of those require a terminal? It
>sounds like your tests show it falling all the way back to
>Noninteractive, but what causes it to skip using Readline?
Readline inherits from Teletype (see the `use base` near the top of
Debconf::FrontEnd::Readline), so checking in the parent class is
enough.
Thanks for checking. I'll get this into unstable today.
--
Colin Watson (he/him) [cjwatson@debian.org]
Message sent on
to Josh Triplett <josh@joshtriplett.org>:
Bug#1061480.
(Mon, 10 Mar 2025 12:09:34 GMT) (full text, mbox, link).
Control: tag -1 pending
Hello,
Bug #1061480 in debconf reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:
https://salsa.debian.org/pkg-debconf/debconf/-/commit/afee267f124111d3d799582c932191596cf32bce
------------------------------------------------------------------------
Teletype: Require stdin to be a tty
Closes: #1061480
------------------------------------------------------------------------
(this message was generated automatically)
--
Greetings
https://bugs.debian.org/1061480
Added tag(s) pending.
Request was from Colin Watson <cjwatson@debian.org>
to 1061480-submitter@bugs.debian.org.
(Mon, 10 Mar 2025 12:09:34 GMT) (full text, mbox, link).
Reply sent
to Colin Watson <cjwatson@debian.org>:
You have taken responsibility.
(Mon, 10 Mar 2025 12:21:01 GMT) (full text, mbox, link).
Notification sent
to Josh Triplett <josh@joshtriplett.org>:
Bug acknowledged by developer.
(Mon, 10 Mar 2025 12:21:02 GMT) (full text, mbox, link).
Source: debconf
Source-Version: 1.5.91
Done: Colin Watson <cjwatson@debian.org>
We believe that the bug you reported is fixed in the latest version of
debconf, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1061480@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated debconf package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Mon, 10 Mar 2025 12:07:15 +0000
Source: debconf
Architecture: source
Version: 1.5.91
Distribution: unstable
Urgency: medium
Maintainer: Debconf Developers <debconf-devel@lists.alioth.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Closes: 1061480
Changes:
debconf (1.5.91) unstable; urgency=medium
.
* Teletype: Require stdin to be a tty (closes: #1061480).
Checksums-Sha1:
258e67779a4053a81b60528b1dd4e25b587d2fcf 2035 debconf_1.5.91.dsc
0cd43ac0c9b8d69755c00876128ca1c969d35997 609964 debconf_1.5.91.tar.xz
Checksums-Sha256:
1aa3ceaef24ef533cfffe7f9ca750c6325dbaea86a7abca77cb4439ceae930d8 2035 debconf_1.5.91.dsc
18f3f43924ccc870be483d7c5f1a9be59e51ae1da403059d654666b5a175bf15 609964 debconf_1.5.91.tar.xz
Files:
eb3bd200620603376cd82815f3bd34ef 2035 admin optional debconf_1.5.91.dsc
d04a65a3250b0a092c17f6421a57855d 609964 admin optional debconf_1.5.91.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmfO1jYACgkQOTWH2X2G
UAu3qRAAsvQ7wOcLgnkHQFELdiHgGnJ/AhyhDOkWTzmMIgLCF1qwArV7LQJQhiZu
8ierUMYwlIoJylKawLINFNA802kH4pt4gUusMLq8AqFROMjcb957SwQD9dnj6lal
Z/9p+qZnK0Iwo4gvyFi8pO6Z2Zm62bBTgZ8pMyhqlAHdvsGVK4HhHtWg1li0Q5UG
NJAT/9JU0Yti5Ul5bQOwITMz9JS+yldR9gU4e1T4mF55zursf5Xyt00uxP+XOBz3
/WMXqVwTQgwllRDEt3f1MXfS9BqYblrNndRigk1Q8nrT92LDWh1QqavFM28gNbdB
vl73U18BZq0vOcin3ejYJAeJJW+pzZ+0a6qyENx7oVWex1k4AM3HZP96PTC2AfPC
GhlQr8fTVQfqnK+TCqcfTkMzvxYARSBKq9Flp1O/PUu9xkL83DI+P5FuuYTA6KqY
BYeFodG1AglpNKIIS8skA9ShErvpQUnX65oLXZxTlV/JfQ0GGKVRdTDJuxQQM68i
4ClQmIDP/JZnMPVUK+a/NgIM7B/WoBPZ70BvRMO193G8Diz+Dw06m4XnKVe1i7m5
6NSuFmxvKEdM/hqxAy3mJqMI59UxlqPE1K8Yb+/2IqbFr5GQsBb4bohjPARWKE9F
Spw5W633IeGVuwxwflX64M+FiJyCeY7KjbK/uT9rVGVxpgRMhwU=
=4/T0
-----END PGP SIGNATURE-----
Information forwarded
to debian-bugs-dist@lists.debian.org, Debconf Developers <debconf-devel@lists.alioth.debian.org>: Bug#1061480; Package debconf.
(Mon, 10 Mar 2025 17:33:01 GMT) (full text, mbox, link).
Acknowledgement sent
to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <debconf-devel@lists.alioth.debian.org>.
(Mon, 10 Mar 2025 17:33:01 GMT) (full text, mbox, link).
Subject: Re: Bug#1061480: debconf should automatically be noninteractive if
input is /dev/null
Date: Mon, 10 Mar 2025 10:29:24 -0700
On Mon, 10 Mar 2025 12:03:54 +0000 Colin Watson <cjwatson@debian.org> wrote:
> On Sun, Mar 09, 2025 at 09:39:29PM -0700, Josh Triplett wrote:
> >I'm not clear why you're removing the `-t STDIN` check from the Readline
> >frontend, though; shouldn't *both* of those require a terminal? It
> >sounds like your tests show it falling all the way back to
> >Noninteractive, but what causes it to skip using Readline?
>
> Readline inherits from Teletype (see the `use base` near the top of
> Debconf::FrontEnd::Readline), so checking in the parent class is
> enough.
Ah, so it does! I missed that. Thanks.
> Thanks for checking. I'll get this into unstable today.
Thank you very much! I'm really looking forward to debconf Just Working
without having to add `DEBIAN_FRONTEND=noninteractive`. And thank you
for proposing and implementing the better solution that makes the less
conservative assumption about people's workflows around automating
debconf.
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.