Bug#2051: etc/ntp.conf is an auto-handled conffile
Ian Jackson writes:
>
> Andrew Howell writes ("Re: Bug#2051: /etc/ntp.conf is an auto-handled conffile"):
> > [Ian Jackson wrote:]
> ...
> > > The ntp.conf file is modified (correctly) by the postinst after
> > > installation. This causes a conffiles conflict when the package is
> > > upgraded.
> > >
> > > I suggest that the package not use dpkg to install the file, but
> > > instead create it itself if it doesn't exist; any changes which need
> > > to be made during upgrades would have to be done manually.
> ...
> >
> > I don't believe this is true. My understand of conffiles is that
> > you are only prompted if the conffile that was distributed with the
> > previous package has a different md5sum to the conffile distributed
> > with the current version of the package.
>
> Yes, this is true.
>
> > This is what I've seen as well, as when I made my new version of the
> > package I had edited ntp.conf and it didn't prompt me for ntp.conf
> > when I installed my new package.
>
> However, it *will* prompt every time the package maintainer edits the
> `source' file from which the file is made - and then the user will get
> prompted about a file they've never heard of.
Ahhh now I follow what you were talking about :)
> > What I believe you saw was when you upgrade from 3.4x-1 to 3.4x-2
> > I had changed the ntp.conf file myself and that's why it prompted you.
> > If you look at the Changelog file you'll notice I moved the driftfile
> > from /etc/ntp.drift to /var/lib/ntp in that revision.
> Indeed. One could expect such changes to occur in the future too,
> surely ?
>
> A package should *either* edit the file in the postinst *or* use the
> dpkg conffiles mechanism, but not both. In this case, since local
> customisation is always necessary and can be done automatically (it's
> good that you've written the script to do this, of course!), you
> should arrange for the postinst to figure out any necessary changes
> and make them (possibly prompting the user).
Okay I'll take the conffile out, what is the best way to install ntp.conf
then? Install it into /tmp and then have the postinst edit and move to /etc
or have the file in the postinst and have it generate the file?
Andrew
--
Dehydration - 34%, Recollection of previous evening - 2%, embarrassment
factor - 91%. Advise repair schedule:- off line for 36 hours, re-boot
startup disk, and replace head - wow, what a night!
-- Kryten in Red Dwarf `The Last Day'
Andrew Howell howellaa@cs.curtin.edu.au
Perth, Western Australia andrew@it.com.au andrew@debian.org
Reply to: