Bug#40766: Rewrite of "configuration files" section
On Sat, Jul 17, 1999 at 08:08:36PM +0200, Stefan Gybas wrote:
> Why is a program in the package allowed to change a conffile but not
> the postinst? The final result is the same: dpkg might ask if I want to
> replace the configuration file when I upgrade the package.
> I, for example, maintain gnujsp (a Java servlet) which depends on
> libapache-mod-jserv (a Servlet engine for Apache, also maintained by me).
> gnujsp's postinst modifies some conffiles of JServ so can be used right
> after it is installed (all changes are reverted when gnujsp is purged).
> With your suggestion, I would have to move some parts of gnujsp's postinst
> to a script into the JServ package and call that script from the postinst
> instead. Whenever I need to make a change to this script, I have to upload
> a new JServ package (or even worse ask another maintainer to update the
> script if I was not the JServ maintainer).
In short, you may not automatically modify the conffile of another package,
either from your postinst or from a program called from your postinst.
Programs in the package are allowed to modify conffiles. For example,
packages like fvwmconf and dotfiles are intended to modify the
configuration files of particular programs, which mean they will modify
conffiles of other packages. That's perfectly fine -- it's no different to
editing them with vi.
> As stated above, the result is the same: We have a modified configuration
> file in both cases. So what should I do? Let the user do the changes to
> the configuration files? Ask a lot of questions in the postinst? IMHO the
> automatic setup in the postinst is a very user friendly solution.
It's a very friendly solution, but later dpkg will ask them about upgrading
configuration files they've never heard of. You should lobby the maintainer
of the package's conffile you want to modify to give you a mechanism
(like updated-inetd etc) to do so.
Hamish Moffatt VK3SB (ex-VK3TYD).
CCs of replies from mailing lists are welcome.