Re: dpkg modification: non-interactivity
>>>>> On Tue, 15 Dec 1998 23:38:46 +0100 (CET), Kristoffer.Rose@ENS-Lyon.FR said:
Kristoffer> Stefan Gybas writes:
>> > a. Policy is changed to FORBID INTERACTION during postinst.
>>
>> You could check a shell variable if interaction is forbidden, ...
Kristoffer> Yes, or pass a parameter with "first" and "second" or
Kristoffer> something. But the migration is then harder as *all*
Kristoffer> scripts need to know about it before it works...
>> This cookie can also be used in the standard postinst. So if you
>> set this cookie before installing (e.g. by copying from a master
>> server), no interaction is required at all.
Kristoffer> Sure, this is ideal. Many postinst-scripts already do
Kristoffer> this. Great, as I comment on in another message. But
Kristoffer> the main point is that my idea is completely transparent
Kristoffer> to the existing system: we file bugs, they get fixed, the
Kristoffer> system gets better and better.
>> postinst could also call a script "get-settings <packagename>"
>> which could be customized by the admin to fetch the "cookies"
>> (e.g. shell variables like CONFIG_SMAIL_SMARTHOST=mailserv and
>> CONFIG_SAMBA_INETD=true) from a server, a local file or even
>> generates them based on the installation host. Then if a variable
>> is set, use that value, otherwise check if interaction is
>> forbidden and use dafaults or ask questions.
Kristoffer> Certainly. But too complicated to be *required* RSN.
>> It's even simpler the above way as it does not require any changes
>> to dpkg at all.
Kristoffer> I think dpkg still needs to know that a package can be
Kristoffer> "half-configured", if I understand you.
I think a `half-configured' state is a bad idea. Packages in their
postinst should pick suitable defaults for anything important. They
should then run something like "register-interactive-command foobar"
in the postinst.
Dpkg then runs a single script at the end of configuration that runs
all the commands like foobar that were registered with the
register-interactive-command. This requires a single change to dpkg
to run the script at the end of configuration.
The interactive commands should feel free to offer to change any of
the defaulted values.
Are there packages that can't default values like this (and would
cause a broken system)?
This, as far as I can see, is the most minimal change to dpkg to allow
for separating interactive scripts from the rest. The
postinst-interactive idea seems a bit of overkill to me.
Also a nice bonus is that once we start to get nice configuration
tools (for console and X) this would blend easily in to using those
for these interactive parts.
Dres
--
@James LewisMoss <dres@ioa.com> | Blessed Be!
@ http://www.ioa.com/~dres | Linux is kewl!
@"Argue for your limitations and sure enough, they're yours." Bach
Reply to: