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

Re: kernel-package hooks transition

On Sat, Dec 24, 2005 at 05:03:17PM +0100, Sven Luther wrote:
> Notice that the debconf helper scripts provide stdout on &3, so any
> scripts writing to stdout only need to redirect their output to &3, no
> ? 

No, that won't work; if you send something to fd 3, it will go to the
debconf frontend and be interpreted as a debconf protocol command. In
any case, it's only the shell confmodule that sets up fd 3 to go to the
frontend, and the kernel-package-generated postinst is written in Perl;
people may well have written postinst.d fragments in Perl too. Please
use stderr instead, or, if possible, just make the script quiet.

The fd 3 redirection (and the corresponding redirection of stdout to
stderr in the shell confmodule) was always acknowledged as a nasty hack
in debconf. At the time, as I understand it, Joey reckoned it was easier
to do that than to try to get everyone to change maintainer script code
that used stdout. It has various undesirable consequences, such as the
requirement to call db_stop before starting daemons that don't take care
to close down all their file descriptors, and some very weird
workarounds in the confmodule bindings for other languages (see the
changelog entry for debconf 0.3.74).

My impression is that these days maintainer scripts are much better
about not mixing up debconf interaction with normal use of stdout, and
so it's still possible that the fd 3 hack will be removed some day.

Colin Watson                                       [cjwatson@debian.org]

Reply to: